summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2018-01-25 00:46:57 +0000
committerTim-Philipp Müller <tim@centricular.com>2018-01-29 11:29:24 +0000
commitddd4fe680f5379d4ddf6ee06166870626f9c5cec (patch)
tree2d50ba6be0dad264cda6e641808fc76a30bc184f
parent07ae64118df86d7e5b711d5966b6dc35009e8473 (diff)
splitmuxsrc: properly set total duration on outgoing segment
We would accidentally pass through the duration value from the demuxer from a single fragment, which causes problems when feeding the stream from splitmuxsrc to rtsp-server. Streaming would stop after one fragment due to that. https://bugzilla.gnome.org/show_bug.cgi?id=792861
-rw-r--r--gst/multifile/gstsplitmuxsrc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gst/multifile/gstsplitmuxsrc.c b/gst/multifile/gstsplitmuxsrc.c
index df8eba2bc..7f1ed653f 100644
--- a/gst/multifile/gstsplitmuxsrc.c
+++ b/gst/multifile/gstsplitmuxsrc.c
@@ -428,6 +428,7 @@ gst_splitmux_handle_event (GstSplitMuxSrc * splitmux,
break;
}
case GST_EVENT_SEGMENT:{
+ GstClockTime duration;
GstSegment seg;
gst_event_copy_segment (event, &seg);
@@ -462,6 +463,15 @@ gst_splitmux_handle_event (GstSplitMuxSrc * splitmux,
}
}
+ GST_OBJECT_LOCK (splitmux);
+ duration = splitmux->total_duration;
+ GST_OBJECT_UNLOCK (splitmux);
+
+ if (duration > 0)
+ seg.duration = duration;
+ else
+ seg.duration = GST_CLOCK_TIME_NONE;
+
GST_INFO_OBJECT (splitpad,
"Forwarding segment %" GST_SEGMENT_FORMAT, &seg);