Skip to content

Commit

Permalink
qtdemux: Don't push GAP event if first buffer is within 1s
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bilboed committed Dec 13, 2017
1 parent 5c341f0 commit 2e45926
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gst/isomp4/qtdemux.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 2e45926

Please sign in to comment.