use of org.schabi.newpipe.playlist.PlayQueue.DEBUG in project NewPipe by TeamNewPipe.
the class MediaSourceManager method maybeSync.
/*//////////////////////////////////////////////////////////////////////////
// Metadata Synchronization
//////////////////////////////////////////////////////////////////////////*/
private void maybeSync() {
if (DEBUG)
Log.d(TAG, "onPlaybackSynchronize() called.");
final PlayQueueItem currentItem = playQueue.getItem();
if (isBlocked.get() || !isPlaybackReady() || currentItem == null)
return;
final Consumer<StreamInfo> onSuccess = info -> syncInternal(currentItem, info);
final Consumer<Throwable> onError = throwable -> syncInternal(currentItem, null);
final Disposable sync = currentItem.getStream().observeOn(AndroidSchedulers.mainThread()).subscribe(onSuccess, onError);
syncReactor.set(sync);
}
Aggregations