Commit 9e8e1c45 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵
Browse files

dashdemux: Seek on the new streams if the seek caused a period switch

Seeking on the old streams is pointless, they are going to be freed on the
next opportunity.
parent fa9b0318
......@@ -1082,6 +1082,7 @@ gst_dash_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek)
GstStreamPeriod *period;
GList *iter;
GstDashDemux *dashdemux = GST_DASH_DEMUX_CAST (demux);
gboolean switched_period = FALSE;
gst_event_parse_seek (seek, &rate, &format, &flags, &start_type, &start,
&stop_type, &stop);
......@@ -1120,10 +1121,12 @@ gst_dash_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek)
if (!gst_mpd_client_set_period_index (dashdemux->client, current_period)
|| !gst_dash_demux_setup_all_streams (dashdemux))
return FALSE;
switched_period = TRUE;
}
/* Update the current sequence on all streams */
for (iter = demux->streams; iter; iter = g_list_next (iter)) {
for (iter = (switched_period ? demux->next_streams : demux->streams); iter;
iter = g_list_next (iter)) {
GstDashDemuxStream *dashstream = iter->data;
if (flags & GST_SEEK_FLAG_FLUSH) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment