mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
streamsynchronizer: Create a GAP event with a sensible timestamp
This commit is contained in:
parent
b793d0bfae
commit
7b12afa4cb
1 changed files with 9 additions and 2 deletions
|
@ -402,6 +402,7 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstObject * parent,
|
|||
gboolean seen_data;
|
||||
GSList *pads = NULL;
|
||||
GstPad *srcpad;
|
||||
GstClockTime timestamp;
|
||||
|
||||
GST_STREAM_SYNCHRONIZER_LOCK (self);
|
||||
stream = gst_pad_get_element_private (pad);
|
||||
|
@ -417,6 +418,11 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstObject * parent,
|
|||
seen_data = stream->seen_data;
|
||||
srcpad = gst_object_ref (stream->srcpad);
|
||||
|
||||
if (stream->segment.rate < 0.0 || stream->segment.stop == -1)
|
||||
timestamp = stream->segment.start;
|
||||
else
|
||||
timestamp = stream->segment.stop;
|
||||
|
||||
for (l = self->streams; l; l = l->next) {
|
||||
GstStream *ostream = l->data;
|
||||
|
||||
|
@ -456,10 +462,11 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstObject * parent,
|
|||
if (!seen_data) {
|
||||
GstEvent *gap_event;
|
||||
|
||||
gap_event = gst_event_new_gap (0, 0);
|
||||
gap_event = gst_event_new_gap (timestamp, GST_CLOCK_TIME_NONE);
|
||||
ret = gst_pad_push_event (srcpad, gap_event);
|
||||
} else {
|
||||
ret = TRUE;
|
||||
}
|
||||
ret = TRUE;
|
||||
}
|
||||
gst_object_unref (srcpad);
|
||||
gst_event_unref (event);
|
||||
|
|
Loading…
Reference in a new issue