mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 20:05:38 +00:00
inputselector: Don't send a NEWSEGMENT event if a buffer arrived before the segment was configured
This commit is contained in:
parent
7952a54299
commit
47de97df84
1 changed files with 13 additions and 9 deletions
|
@ -805,17 +805,21 @@ gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
|
|||
}
|
||||
/* if we have a pending segment, push it out now */
|
||||
if (G_UNLIKELY (selpad->segment_pending)) {
|
||||
GST_DEBUG_OBJECT (pad,
|
||||
"pushing pending NEWSEGMENT update %d, rate %lf, applied rate %lf, "
|
||||
"format %d, "
|
||||
"%" G_GINT64_FORMAT " -- %" G_GINT64_FORMAT ", time %"
|
||||
G_GINT64_FORMAT, FALSE, seg->rate, seg->applied_rate, seg->format,
|
||||
seg->start, seg->stop, seg->time);
|
||||
if (G_UNLIKELY (seg->format == GST_FORMAT_UNDEFINED)) {
|
||||
GST_ERROR_OBJECT (pad, "Buffers arrived before NEWSEGMENT event");
|
||||
|
||||
start_event = gst_event_new_new_segment_full (FALSE, seg->rate,
|
||||
seg->applied_rate, seg->format, seg->start, seg->stop, seg->time);
|
||||
} else {
|
||||
GST_DEBUG_OBJECT (pad,
|
||||
"pushing pending NEWSEGMENT update %d, rate %lf, applied rate %lf, "
|
||||
"format %d, "
|
||||
"%" G_GINT64_FORMAT " -- %" G_GINT64_FORMAT ", time %"
|
||||
G_GINT64_FORMAT, FALSE, seg->rate, seg->applied_rate, seg->format,
|
||||
seg->start, seg->stop, seg->time);
|
||||
|
||||
selpad->segment_pending = FALSE;
|
||||
start_event = gst_event_new_new_segment_full (FALSE, seg->rate,
|
||||
seg->applied_rate, seg->format, seg->start, seg->stop, seg->time);
|
||||
selpad->segment_pending = FALSE;
|
||||
}
|
||||
}
|
||||
GST_INPUT_SELECTOR_UNLOCK (sel);
|
||||
|
||||
|
|
Loading…
Reference in a new issue