mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-10-21 18:37:39 +00:00
-[#1383]Fixed popup player caption selector not populating due to full width aspect ratio selector.
-Fixed potential memory leak in media session connector containing player instance.
This commit is contained in:
@@ -285,9 +285,11 @@ public abstract class BasePlayer implements
|
|||||||
destroyPlayer();
|
destroyPlayer();
|
||||||
unregisterBroadcastReceiver();
|
unregisterBroadcastReceiver();
|
||||||
|
|
||||||
|
if (mediaSessionManager != null) mediaSessionManager.dispose();
|
||||||
|
|
||||||
trackSelector = null;
|
trackSelector = null;
|
||||||
simpleExoPlayer = null;
|
|
||||||
mediaSessionManager = null;
|
mediaSessionManager = null;
|
||||||
|
simpleExoPlayer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*//////////////////////////////////////////////////////////////////////////
|
/*//////////////////////////////////////////////////////////////////////////
|
||||||
@@ -494,22 +496,6 @@ public abstract class BasePlayer implements
|
|||||||
(manifest == null ? "no manifest" : "available manifest") + ", " +
|
(manifest == null ? "no manifest" : "available manifest") + ", " +
|
||||||
"timeline size = [" + timeline.getWindowCount() + "], " +
|
"timeline size = [" + timeline.getWindowCount() + "], " +
|
||||||
"reason = [" + reason + "]");
|
"reason = [" + reason + "]");
|
||||||
if (playQueue == null) return;
|
|
||||||
|
|
||||||
switch (reason) {
|
|
||||||
case Player.TIMELINE_CHANGE_REASON_RESET: // called after #block
|
|
||||||
case Player.TIMELINE_CHANGE_REASON_PREPARED: // called after #unblock
|
|
||||||
case Player.TIMELINE_CHANGE_REASON_DYNAMIC: // called after playlist changes
|
|
||||||
// Ensures MediaSourceManager#update is complete
|
|
||||||
final boolean isPlaylistStable = timeline.getWindowCount() == playQueue.size();
|
|
||||||
// Ensure dynamic/livestream timeline changes does not cause negative position
|
|
||||||
if (isPlaylistStable && !isCurrentWindowValid() && !isSynchronizing) {
|
|
||||||
if (DEBUG) Log.d(TAG, "Playback - negative time position reached, " +
|
|
||||||
"clamping to default position.");
|
|
||||||
seekToDefault();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -598,7 +584,7 @@ public abstract class BasePlayer implements
|
|||||||
} else if (isSynchronizing && isLive()) {
|
} else if (isSynchronizing && isLive()) {
|
||||||
// Is still synchronizing?
|
// Is still synchronizing?
|
||||||
if (DEBUG) Log.d(TAG, "Playback - Synchronizing livestream to default time");
|
if (DEBUG) Log.d(TAG, "Playback - Synchronizing livestream to default time");
|
||||||
seekToDefault();
|
//seekToDefault();
|
||||||
|
|
||||||
} else if (isSynchronizing && presetStartPositionMillis > 0L) {
|
} else if (isSynchronizing && presetStartPositionMillis > 0L) {
|
||||||
// Has another start position?
|
// Has another start position?
|
||||||
|
@@ -39,6 +39,9 @@ public class MediaSessionManager {
|
|||||||
return MediaButtonReceiver.handleIntent(mediaSession, intent);
|
return MediaButtonReceiver.handleIntent(mediaSession, intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Should be called on player destruction to prevent leakage.
|
||||||
|
* */
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
this.sessionConnector.setPlayer(null, null);
|
this.sessionConnector.setPlayer(null, null);
|
||||||
this.sessionConnector.setQueueNavigator(null);
|
this.sessionConnector.setQueueNavigator(null);
|
||||||
|
@@ -111,7 +111,7 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/resizeTextView"
|
android:id="@+id/resizeTextView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
|
Reference in New Issue
Block a user