mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 12:10:37 +00:00
mssdemux: push newsegments with same start time on bitrate switches
This keeps sinks working in sync after a bitrate switch
This commit is contained in:
parent
c2ae981e6d
commit
1116eee681
1 changed files with 11 additions and 0 deletions
|
@ -780,6 +780,7 @@ gst_mss_demux_reconfigure (GstMssDemux * mssdemux)
|
||||||
gst_mss_demux_stop_tasks (mssdemux, TRUE);
|
gst_mss_demux_stop_tasks (mssdemux, TRUE);
|
||||||
if (gst_mss_manifest_change_bitrate (mssdemux->manifest,
|
if (gst_mss_manifest_change_bitrate (mssdemux->manifest,
|
||||||
mssdemux->connection_speed)) {
|
mssdemux->connection_speed)) {
|
||||||
|
GstClockTime newseg_ts = GST_CLOCK_TIME_NONE;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (mssdemux, "Creating new pad group");
|
GST_DEBUG_OBJECT (mssdemux, "Creating new pad group");
|
||||||
/* if we changed the bitrate, we need to add new pads */
|
/* if we changed the bitrate, we need to add new pads */
|
||||||
|
@ -819,6 +820,9 @@ gst_mss_demux_reconfigure (GstMssDemux * mssdemux)
|
||||||
(stream->manifest_stream);
|
(stream->manifest_stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ts < newseg_ts)
|
||||||
|
newseg_ts = ts;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (mssdemux,
|
GST_DEBUG_OBJECT (mssdemux,
|
||||||
"Seeking stream %p %s to ts %" GST_TIME_FORMAT, stream,
|
"Seeking stream %p %s to ts %" GST_TIME_FORMAT, stream,
|
||||||
GST_PAD_NAME (stream->pad), GST_TIME_ARGS (ts));
|
GST_PAD_NAME (stream->pad), GST_TIME_ARGS (ts));
|
||||||
|
@ -840,6 +844,13 @@ gst_mss_demux_reconfigure (GstMssDemux * mssdemux)
|
||||||
gst_element_remove_pad (GST_ELEMENT (mssdemux), oldpad);
|
gst_element_remove_pad (GST_ELEMENT (mssdemux), oldpad);
|
||||||
gst_object_unref (oldpad);
|
gst_object_unref (oldpad);
|
||||||
}
|
}
|
||||||
|
for (iter = mssdemux->streams; iter; iter = g_slist_next (iter)) {
|
||||||
|
GstMssDemuxStream *stream = iter->data;
|
||||||
|
|
||||||
|
stream->pending_newsegment =
|
||||||
|
gst_event_new_new_segment (TRUE, 1.0, GST_FORMAT_TIME, newseg_ts, -1,
|
||||||
|
newseg_ts);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
gst_mss_demux_restart_tasks (mssdemux);
|
gst_mss_demux_restart_tasks (mssdemux);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue