GNOME Bugzilla – Bug 770075
adaptivedemux: fix stream exposure condition
Last modified: 2016-08-22 16:05:10 UTC
Created attachment 333548 [details] [review] adaptivedemux: fix stream exposure condition The new streams should not be exposed until all streams are done with the current fragment. The old code is incorrect and actually only checked the current stream. Fix this by properly checking all streams. Also, ignore the current stream. The code is only reached when the current stream finished downloading and since 65f2ce3c2f1f26b30bbf807b35b1faf23504fe7c ("adaptivedemux: On EOS, handle it before waking download loop") download_finished is set after gst_adaptive_demux_stream_advance_fragment_unlocked() is called. Without this HLS playback with multiple streams is broken, because the new streams are never exposed.
Note: even with this change, switching bitrates with HLS doesn't work very well for me. What I observe is, that audio plays without problems and video stops for several seconds. I think, what happens is this: - the main stream contains only video - audio is in a separate stream When the first fragment of the main stream is done, it triggers a bitrate change. At this point in time the audio stream is already at least on fragment ahead. By the time playbin switches to the new streams, the video is already too late. I'm not sure how to fix this. Do we need to throttle the streams in some way?
That would be commit 07f49f15 in master.
Created attachment 333860 [details] [review] adaptivedemux: fix stream exposure condition Right, I git the commit hash from the wrong branch. Fixed.
Thanks, pushed as 0a63569fd16354464df9b3e3629fb56c4f9b3c43! I think some throttling of downloading of the audio streams would be good, but I'm not sure what the most sensible way to do it is. In general, we can't match up sequence numbers across streams. Something based on the timestamping code might work, but also requires extracting timestamps from the subtitle streams, and the audio id3 tag only provides a start timestamp for each fragment, not the end time.