mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
outputselector: Don't send last segment/buffer when no segment was configured yet
This commit is contained in:
parent
7fb67e9d6f
commit
7952a54299
1 changed files with 5 additions and 3 deletions
|
@ -179,7 +179,7 @@ gst_output_selector_init (GstOutputSelector * sel,
|
||||||
/* srcpad management */
|
/* srcpad management */
|
||||||
sel->active_srcpad = NULL;
|
sel->active_srcpad = NULL;
|
||||||
sel->nb_srcpads = 0;
|
sel->nb_srcpads = 0;
|
||||||
gst_segment_init (&sel->segment, GST_FORMAT_TIME);
|
gst_segment_init (&sel->segment, GST_FORMAT_UNDEFINED);
|
||||||
sel->pending_srcpad = NULL;
|
sel->pending_srcpad = NULL;
|
||||||
|
|
||||||
sel->resend_latest = FALSE;
|
sel->resend_latest = FALSE;
|
||||||
|
@ -462,10 +462,12 @@ gst_output_selector_switch (GstOutputSelector * osel)
|
||||||
osel->pending_srcpad = NULL;
|
osel->pending_srcpad = NULL;
|
||||||
GST_OBJECT_UNLOCK (GST_OBJECT (osel));
|
GST_OBJECT_UNLOCK (GST_OBJECT (osel));
|
||||||
|
|
||||||
/* Send NEWSEGMENT event and latest buffer if switching succeeded */
|
/* Send NEWSEGMENT event and latest buffer if switching succeeded
|
||||||
if (res) {
|
* and we already have a valid segment configured */
|
||||||
|
if (res && osel->segment.format != GST_FORMAT_UNDEFINED) {
|
||||||
/* Send NEWSEGMENT to the pad we are going to switch to */
|
/* Send NEWSEGMENT to the pad we are going to switch to */
|
||||||
seg = &osel->segment;
|
seg = &osel->segment;
|
||||||
|
|
||||||
/* If resending then mark newsegment start and position accordingly */
|
/* If resending then mark newsegment start and position accordingly */
|
||||||
if (osel->resend_latest && osel->latest_buffer &&
|
if (osel->resend_latest && osel->latest_buffer &&
|
||||||
GST_BUFFER_TIMESTAMP_IS_VALID (osel->latest_buffer)) {
|
GST_BUFFER_TIMESTAMP_IS_VALID (osel->latest_buffer)) {
|
||||||
|
|
Loading…
Reference in a new issue