summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2017-12-13 11:35:37 +0100
committerEdward Hervey <bilboed@bilboed.com>2017-12-13 11:35:37 +0100
commit2e45926a96ec5298c6ef29bf912e5e6a06dc3e0e (patch)
tree1f2a24acac1a780db8034c6794d81d54e8b2c2f2 /gst
parent5c341f09802a611cc4a7ff4c5f25b15fe06e3806 (diff)
qtdemux: Don't push GAP event if first buffer is within 1s
If we saw empty segments, we previously unconditionally pushed a GAP event downstream regardless of the duration of that empty segment. In order to avoid issues with initial negotiation of downstream elements (which would negotiate to something before receiving any data due to that initial GAP event), check if there's at least a second of difference (like we do for other GAP-related checks in qtdemux) before deciding to push a GAP event downstream.
Diffstat (limited to 'gst')
-rw-r--r--gst/isomp4/qtdemux.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
index b38e88ecf..91a22dc9e 100644
--- a/gst/isomp4/qtdemux.c
+++ b/gst/isomp4/qtdemux.c
@@ -5811,8 +5811,10 @@ gst_qtdemux_loop_state_movie (GstQTDemux * qtdemux)
GST_TIME_ARGS (dts), GST_TIME_ARGS (pts), GST_TIME_ARGS (duration));
if (G_UNLIKELY (empty)) {
- /* empty segment, push a gap and move to the next one */
- gst_pad_push_event (stream->pad, gst_event_new_gap (pts, duration));
+ /* empty segment, push a gap if there's more than a second
+ * difference and move to the next one */
+ if ((pts + duration - stream->segment.position) > GST_SECOND)
+ gst_pad_push_event (stream->pad, gst_event_new_gap (pts, duration));
stream->segment.position = pts + duration;
goto next;
}