From 21b252727d05ae02388209ecc5cfca85b9ca33d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 30 Nov 2011 14:25:11 +0100 Subject: [PATCH] playsinkconvertbin: Don't send undefined NEWSEGMENT events to the internal elements This happens when the internal elements are added before any NEWSEGMENT event arrived and in that case we shouldn't send a NEWSEGMENT event to the internal elements at all. They will get the NEWSEGMENT event from upstream later. --- gst/playback/gstplaysinkconvertbin.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gst/playback/gstplaysinkconvertbin.c b/gst/playback/gstplaysinkconvertbin.c index b3655264f3..d05f2ac517 100644 --- a/gst/playback/gstplaysinkconvertbin.c +++ b/gst/playback/gstplaysinkconvertbin.c @@ -84,16 +84,18 @@ distribute_running_time (GstElement * element, const GstSegment * segment) gst_pad_send_event (pad, gst_event_new_flush_start ()); gst_pad_send_event (pad, gst_event_new_flush_stop ()); - if (segment->accum) { + if (segment->accum && segment->format != GST_FORMAT_UNDEFINED) { event = gst_event_new_new_segment_full (FALSE, segment->rate, segment->applied_rate, segment->format, 0, segment->accum, 0); gst_pad_send_event (pad, event); } - event = gst_event_new_new_segment_full (FALSE, segment->rate, - segment->applied_rate, segment->format, - segment->start, segment->stop, segment->time); - gst_pad_send_event (pad, event); + if (segment->format != GST_FORMAT_UNDEFINED) { + event = gst_event_new_new_segment_full (FALSE, segment->rate, + segment->applied_rate, segment->format, + segment->start, segment->stop, segment->time); + gst_pad_send_event (pad, event); + } gst_object_unref (pad); }