-Fixed media source manager sync identical item multiple times, causing OOM.

-Removed deprecated translated leak canary string from other languages.
This commit is contained in:
John Zhen Mo 2018-02-18 00:26:53 -08:00
parent e21d2bd511
commit 762f374f93
7 changed files with 12 additions and 15 deletions

View File

@ -105,6 +105,7 @@ public class MediaSourceManager {
playQueueReactor = null;
syncReactor = null;
syncedItem = null;
sources = null;
}
@ -124,6 +125,8 @@ public class MediaSourceManager {
* */
public void reset() {
tryBlock();
syncedItem = null;
populateSources();
}
/*//////////////////////////////////////////////////////////////////////////
@ -243,20 +246,20 @@ public class MediaSourceManager {
syncInternal(currentItem, null);
};
final Disposable sync = currentItem.getStream()
.observeOn(AndroidSchedulers.mainThread())
.subscribe(onSuccess, onError);
syncReactor.add(sync);
if (syncedItem != currentItem) {
syncedItem = currentItem;
final Disposable sync = currentItem.getStream()
.observeOn(AndroidSchedulers.mainThread())
.subscribe(onSuccess, onError);
syncReactor.add(sync);
}
}
private void syncInternal(@android.support.annotation.NonNull final PlayQueueItem item,
@Nullable final StreamInfo info) {
if (playQueue == null || playbackListener == null) return;
// Sync each new item once only and ensure the current item is up to date
// with the play queue
if (playQueue.getItem() != syncedItem && playQueue.getItem() == item) {
syncedItem = item;
// Ensure the current item is up to date with the play queue
if (playQueue.getItem() == item && playQueue.getItem() == syncedItem) {
playbackListener.sync(syncedItem,info);
}
}

View File

@ -373,5 +373,4 @@
<string name="caption_none">Keine Untertitel</string>
<string name="caption_font_size_settings_title">Schriftgröße der Untertitel</string>
<string name="toggle_leak_canary">"Speicherlecks nachverfolgen "</string>
</resources>

View File

@ -395,7 +395,6 @@
<string name="normal_caption_font_size">Carattere normale</string>
<string name="larger_caption_font_size">Carattere più grande</string>
<string name="toggle_leak_canary">Controllo delle perdite</string>
<string name="enable_leak_canary_notice">Controllo delle perdite di memoria abilitato, l\'applicazione può non rispondere mentre effettua il dumping dell\'heap</string>
<string name="disable_leak_canary_notice">Controllo delle perdite di memoria disabilitato</string>
<string name="drawer_header_action_paceholder_text">A breve qualcosa si troverà qui ;D</string>

View File

@ -383,7 +383,6 @@
<string name="normal_caption_font_size">Normal skrift</string>
<string name="larger_caption_font_size">Større skrift</string>
<string name="toggle_leak_canary">Hold oppsyn med lekkasjer</string>
<string name="enable_leak_canary_notice">Oppsyn med minnelekasjer påslått, programmet kan slutte å svare under haug-dumping</string>
<string name="disable_leak_canary_notice">Oppsyn med minnelekasjer slått av</string>
</resources>

View File

@ -391,7 +391,6 @@ te openen in pop-upmodus</string>
<string name="normal_caption_font_size">Normaal lettertype</string>
<string name="larger_caption_font_size">Groter lettertype</string>
<string name="toggle_leak_canary">Controleren op lekken</string>
<string name="enable_leak_canary_notice">Controleren op geheugenlekken ingeschakeld, tijdens heapdumping kan de app tijdelijk niet reageren</string>
<string name="disable_leak_canary_notice">Controleren op geheugenlekken uitgeschakeld</string>
<string name="drawer_header_action_paceholder_text">Hier zal binnenkort iets verschijnen ;D</string>

View File

@ -369,7 +369,6 @@ abrir em modo popup</string>
<string name="normal_caption_font_size">Fonte normal</string>
<string name="larger_caption_font_size">Maior fonte</string>
<string name="toggle_leak_canary">Monitorar vazamentos de memória</string>
<string name="enable_leak_canary_notice">Monitoramento de vazamentos de memória habilitado, o aplicativo pode ficar sem responder quando estiver descarregando pilha de memória</string>
<string name="disable_leak_canary_notice">Monitoramento de vazamentos de memória desabilitado</string>
</resources>

View File

@ -385,7 +385,6 @@
<string name="normal_caption_font_size">Olağan Yazı Tipi</string>
<string name="larger_caption_font_size">Büyük Yazı Tipi</string>
<string name="toggle_leak_canary">Sızıntıları Gözlemle</string>
<string name="enable_leak_canary_notice">Bellek sızıntısı gözlemleme etkinleştirildi, uygulama yığın atımı sırasında yanıtsız kalabilir</string>
<string name="disable_leak_canary_notice">Bellek sızıntısı gözlemleme devre dışı</string>
</resources>