Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chunk end time in playeremsghandler should respect trackformat #8408

Closed
mengli1986 opened this issue Dec 28, 2020 · 3 comments
Closed

Chunk end time in playeremsghandler should respect trackformat #8408

mengli1986 opened this issue Dec 28, 2020 · 3 comments
Assignees
Labels

Comments

@mengli1986
Copy link

mengli1986 commented Dec 28, 2020

As shown here, the lastLoadedChunkEndTimeUs is updated when chunk load is completed. However, there are both audio and media chunks loading simultaneously, and they both update this lastLoadedChunkEndTimeUs when they finish loading. This cause confusion, and I particularly found it cause issue in retry scenarios. When there are intermittent network interruptions, I do want retry for both segment fetch and manifest refresh. However, as printed below from debug log, audio and video streams are both updating chunk end time. The last update happens for the video stream with chunk end time of 1413436000. Right after that, the network is off while the audio stream is loading, which triggers the maybeRefreshManifestOnLoadingError method in playeremsghandler. The audio stream has a chunkstarttime > lastchunkendtime, which further triggers isAfterForwardSeek flag in maybeRefreshManifestOnLoadingError method. The end result is isWaitingForManifestRefresh flag becomes alive, which stops the segment retry. Note this issue is reproducible and happens intermittently, depends on the racing condition of audio and video chunk end time update. I think it is better to specifically use audio chunk endtime for audio and video chunkendtime for video.

Thanks!

update chunk end time 11411434000  with format Format(dash-lp-hd1-v, video/mp4, video/avc, avc1.4d401e, 3300000, null, [1280, 720, 30.0], [-1, -1])
update chunk end time 11415438000 with format Format(dash-lp-ld-a, audio/mp4, audio/mp4a-latm, mp4a.40.2, 131814, null, [-1, -1, -1.0], [-1, 48000])
update chunk end time 11413436000 with format Format(dash-lp-hd1-v, video/mp4, video/avc, avc1.4d401e, 3300000, null, [1280, 720, 30.0], [-1, -1])

lastLoadedChunkEndTimeUs != C.TIME_UNSET && lastLoadedChunkEndTimeUs < chunk.startTimeUs;

Loader Retry Error log for cases where both segment and manifest are retried (use callback in loader to represent what is being retried):

Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream
Retry for class com.google.android.exoplayer2.source.chunk.ChunkSampleStream

Loader Retry Log for the case where only manifest retry is performed and segment retry is disabled (due to the issue mentioned)

Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
Retry for class com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback
@ojw28 ojw28 added bug and removed question labels Jan 6, 2021
ojw28 added a commit that referenced this issue Jan 8, 2021
@ojw28
Copy link
Contributor

ojw28 commented Jan 8, 2021

@mengli1986 - I've submitted the commit referenced above to address this issue. However, I did not have a suitable stream to test with, so I essentially fixed it blind. Please could you test the fix and report back whether it resolves the issue? We would like to get this into 2.13.0, but reserve the right to not do so unless we have confirmation that it solved the problem :). Thanks!

@mengli1986
Copy link
Author

Awesome. Thanks for the quick fix!

@ojw28
Copy link
Contributor

ojw28 commented Jan 13, 2021

As per my previous response, please test the fix and report back whether it resolves the issue. We reserve the right to remove it from the 2.13.0 unless we have verification that it did indeed fix the issue. Thanks!

@ojw28 ojw28 closed this as completed Jan 13, 2021
@google google locked and limited conversation to collaborators Mar 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants