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 07f49f15b1196cc9fa0d45af91149a35fce123b9 ("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. https://bugzilla.gnome.org/show_bug.cgi?id=770075
This commit is contained in:
parent
3550fb3a6a
commit
0a63569fd1
@ -3677,10 +3677,13 @@ gst_adaptive_demux_stream_advance_fragment_unlocked (GstAdaptiveDemux * demux,
|
||||
|
||||
for (iter = demux->streams; iter; iter = g_list_next (iter)) {
|
||||
/* Only expose if all streams are now cancelled or finished downloading */
|
||||
g_mutex_lock (&stream->fragment_download_lock);
|
||||
can_expose &= (stream->cancelled == TRUE
|
||||
|| stream->download_finished == TRUE);
|
||||
g_mutex_unlock (&stream->fragment_download_lock);
|
||||
GstAdaptiveDemuxStream *other = iter->data;
|
||||
if (other != stream) {
|
||||
g_mutex_lock (&other->fragment_download_lock);
|
||||
can_expose &= (other->cancelled == TRUE
|
||||
|| other->download_finished == TRUE);
|
||||
g_mutex_unlock (&other->fragment_download_lock);
|
||||
}
|
||||
}
|
||||
|
||||
if (can_expose) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user