-
Notifications
You must be signed in to change notification settings - Fork 6k
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
HLS: MergingMediaSource with two HlsMediaSources buffers indefinitely near beginning of stream #8850
Comments
Thanks for the demo app to reproduce the issue. I was able to see the behaviour you report when building against 2.13.3, and also against the dev-v2 version of the commit you identified (6f8a8fb). When building against its immediate predecessor on dev-v2 (6b63bb2), the playback continued beyond the 18s mark. So I agree this seems to be a regression introduced by that commit. Assigning to @ojw28 as the author of that commit to investigate further. |
Can confirm that this is still an issue in 2.14.0, preventing upgrading past 2.13.2. @ojw28 any progress here? Thanks! |
@brianschrameck I'm not sure the ExoPlayer team @ojw28 is working on this or not. We are working on what I suspect (without your app I can't confirm) is a related issue. You can look at my comments on commit (6f8a8fb). For us allowing audio master (which the commit does) prevents a deadlock when the EXT-X-DISCONTINUITY sequence changes on the audio playlist first. Our issue (see Issue #8952 ) is the side effect, demuxed audio resets the offset from playlist time to media time, causes ugly periods of frozen video with sound playing when discontinuity occurs or during seek. I am working on a solution where the If I could see some sample playlists from your situation that have this issue I can see if the fix will hurt or help your use case. |
Our use case is a little different as we are playing two audio-only streams and synchronizing them using a MergingMediaSource. I've attached two example HLS playlists; we then merge them together and play simultaneously. Both work fine when played individually, though. It's just when merging them and playing simultaneously where there's an issue. It does sound like an issue with segment alignment between tracks as you mentioned in your comments on the commit. I don't think it's unreasonable to assume that segments may not be aligned as I don't believe there's anything in the spec that say they need to be. FWIW our segments are only very slightly misaligned. |
@brianschrameck The playlists you attached do not have any discontinuities. If the actual application is live and has discontinuities that could certainly trigger the timestamp adjustment. Note the purpose of the At any rate, when the fix for #8952 is ready we'll have a public pull you can try, or if the ExoPlayer team does it first of course. |
Correct, no discontinuities in these, but the live app does have them. We don't ever make it that far, though, so the they are irrelevant. We extended Looking at the two HLS streams, we see Stream 1:
and Stream 2:
Notice how the byte ranges match up until the third segment. And it just so happens it seems that this is where playback stalls; sometime around 18 seconds. I don't know enough about how |
If the PTS values reset in that third segment it must be marked with an |
Sorry, I'm not really following. Nothing like that is mentioned in the spec or in Apple's |
As long as the timestamps (PTS) in So I'm confused as to what is the nature of the "discontinuity" you mentioned:
|
Thanks, I've edited the original post to correct the terminology. |
Easy to see if you are stuck in the wait. Look for I'll keep any eye on this bug too as we prepare a proposed fix for #8952 |
Yeah, there looks to be missing a loadCompleted event.
|
Can confirm that this is still a problem on 2.14.2. Any progress looking into this? |
I am looking at some other issues that 0d052e0 caused currently. Once I have a fix for those I'll see if it also fixes this issue at the same time. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I think this should be fixed by the commit referenced above. Please give it a try! |
Looks good here, thank you! |
Our app streams two HLS audio tracks simultaneously that need to stay synchronized with each other. We have implemented custom code in order to keep these two audio tracks synchronized using a single player.
After upgrading from 2.13.2 to 2.13.3 (mainly so we don't need to use the JCenter repos), our app starts streaming HLS content but then starts buffering (endlessly) immediately prior to the third byte range, sometime between 16 seconds and 18 seconds for every stream. If we kill the app, restart, and resume playing where we left off, the rest of the stream continues successfully without buffering.
The following messages appear in the debug console while streaming, but it may be unrelated:
I think I've narrowed the problem down to 0d052e0 which was intended to address #8700 and #8372. Pretty sure that the thread is falling into the following block and never getting notified:
I will be following up via email with the ExoPlayer demo app that's been modified to use our custom player.
Start streaming the example in the demo app. You can see the buffer stops loading between 16 and 18 seconds and once the playback buffer is exhausted, playback stops. It is expected that the stream will continue to completion.
This will be included in my email correspondence
These are included in the demo app
2.13.3 (this code works on 2.13.2)
11 (also reproducible on 10 emulator)
Google Pixel 4a (also reproducible on emulator)
Thanks for any assistance!
The text was updated successfully, but these errors were encountered: