mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 23:18:52 +00:00
dashdemux: push a time segment when restarting streaming
This should inform demuxers/decoders downstream that the stream is about to start from a new position and they should flush accordingly https://bugzilla.gnome.org/show_bug.cgi?id=736319
This commit is contained in:
parent
35bd1969f9
commit
2273c15f15
1 changed files with 8 additions and 3 deletions
|
@ -2283,9 +2283,10 @@ gst_dash_demux_stream_download_fragment (GstDashDemux * demux,
|
||||||
GstFlowReturn ret = GST_FLOW_OK;
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
|
|
||||||
if (G_UNLIKELY (stream->restart_download)) {
|
if (G_UNLIKELY (stream->restart_download)) {
|
||||||
|
GstSegment segment;
|
||||||
GstClockTime cur, ts;
|
GstClockTime cur, ts;
|
||||||
gint64 pos;
|
gint64 pos;
|
||||||
GstEvent *gap;
|
GstEvent *seg_event;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (stream->pad,
|
GST_DEBUG_OBJECT (stream->pad,
|
||||||
"Reactivating stream after to reconfigure event");
|
"Reactivating stream after to reconfigure event");
|
||||||
|
@ -2330,14 +2331,18 @@ gst_dash_demux_stream_download_fragment (GstDashDemux * demux,
|
||||||
GST_DEBUG_OBJECT (stream->pad, "Restarting stream at "
|
GST_DEBUG_OBJECT (stream->pad, "Restarting stream at "
|
||||||
"position %" GST_TIME_FORMAT, GST_TIME_ARGS (ts));
|
"position %" GST_TIME_FORMAT, GST_TIME_ARGS (ts));
|
||||||
|
|
||||||
|
gst_segment_copy_into (&demux->segment, &segment);
|
||||||
if (GST_CLOCK_TIME_IS_VALID (ts)) {
|
if (GST_CLOCK_TIME_IS_VALID (ts)) {
|
||||||
gst_mpd_client_stream_seek (demux->client, stream->active_stream, ts);
|
gst_mpd_client_stream_seek (demux->client, stream->active_stream, ts);
|
||||||
|
|
||||||
if (cur < ts) {
|
if (cur < ts) {
|
||||||
gap = gst_event_new_gap (cur, ts - cur);
|
segment.position = ts;
|
||||||
gst_pad_push_event (stream->pad, gap);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
seg_event = gst_event_new_segment (&segment);
|
||||||
|
GST_DEBUG_OBJECT (stream->pad, "Sending restart segment: %"
|
||||||
|
GST_PTR_FORMAT, seg_event);
|
||||||
|
gst_pad_push_event (stream->pad, seg_event);
|
||||||
|
|
||||||
stream->restart_download = FALSE;
|
stream->restart_download = FALSE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue