mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fix that loadingFinished is never set to true.
Previously loadingFinished will never be set to true because it started in false, and we are and'ing it with `canceled`. #minor-release PiperOrigin-RevId: 370662456
This commit is contained in:
parent
65bb4eba25
commit
bf04bb5bc0
1 changed files with 8 additions and 3 deletions
|
|
@ -353,6 +353,13 @@ public final class RtspMediaPeriod implements MediaPeriod {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateLoadingFinished() {
|
||||||
|
loadingFinished = true;
|
||||||
|
for (int i = 0; i < rtspLoaderWrappers.size(); i++) {
|
||||||
|
loadingFinished &= rtspLoaderWrappers.get(i).canceled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static ImmutableList<TrackGroup> buildTrackGroups(
|
private static ImmutableList<TrackGroup> buildTrackGroups(
|
||||||
ImmutableList<RtspLoaderWrapper> rtspLoaderWrappers) {
|
ImmutableList<RtspLoaderWrapper> rtspLoaderWrappers) {
|
||||||
ImmutableList.Builder<TrackGroup> listBuilder = new ImmutableList.Builder<>();
|
ImmutableList.Builder<TrackGroup> listBuilder = new ImmutableList.Builder<>();
|
||||||
|
|
@ -583,9 +590,7 @@ public final class RtspMediaPeriod implements MediaPeriod {
|
||||||
canceled = true;
|
canceled = true;
|
||||||
|
|
||||||
// Update loadingFinished every time loading is canceled.
|
// Update loadingFinished every time loading is canceled.
|
||||||
for (int i = 0; i < rtspLoaderWrappers.size(); i++) {
|
updateLoadingFinished();
|
||||||
loadingFinished &= rtspLoaderWrappers.get(i).canceled;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Resets the {@link Loadable} and {@link SampleQueue} to prepare for an RTSP seek. */
|
/** Resets the {@link Loadable} and {@link SampleQueue} to prepare for an RTSP seek. */
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue