diff options
-rw-r--r-- | gst-libs/gst/adaptivedemux/gstadaptivedemux.c | 5 | ||||
-rw-r--r-- | gst-libs/gst/adaptivedemux/gstadaptivedemux.h | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c index a0f400712..6e5243e87 100644 --- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c +++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c @@ -1260,6 +1260,7 @@ gst_adaptive_demux_expose_streams (GstAdaptiveDemux * demux) gst_task_stop (stream->download_task); g_mutex_lock (&stream->fragment_download_lock); stream->cancelled = TRUE; + stream->replaced = TRUE; g_cond_signal (&stream->fragment_download_cond); g_mutex_unlock (&stream->fragment_download_lock); } @@ -1923,6 +1924,7 @@ gst_adaptive_demux_start_tasks (GstAdaptiveDemux * demux, if (!start_preroll_streams) { g_mutex_lock (&stream->fragment_download_lock); stream->cancelled = FALSE; + stream->replaced = FALSE; g_mutex_unlock (&stream->fragment_download_lock); } @@ -3639,6 +3641,9 @@ gst_adaptive_demux_stream_download_loop (GstAdaptiveDemuxStream * stream) goto end; } gst_task_stop (stream->download_task); + if (stream->replaced) { + goto end; + } } else { gst_task_stop (stream->download_task); if (gst_adaptive_demux_combine_flows (demux) == GST_FLOW_EOS) { diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.h b/gst-libs/gst/adaptivedemux/gstadaptivedemux.h index 830171467..642b06c68 100644 --- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.h +++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.h @@ -157,7 +157,8 @@ struct _GstAdaptiveDemuxStream GMutex fragment_download_lock; GCond fragment_download_cond; gboolean download_finished; /* protected by fragment_download_lock */ - gboolean cancelled; /* protected by fragment_download_lock */ + gboolean cancelled; /* protected by fragment_download_lock */ + gboolean replaced; /* replaced in a bitrate switch (used with cancelled) */ gboolean src_at_ready; /* protected by fragment_download_lock */ gboolean starting_fragment; gboolean first_fragment_buffer; |