From: Stefan Sauer Date: Thu, 1 Dec 2011 10:59:17 +0000 (+0100) Subject: adder: be more graceful in the clipfunction X-Git-Tag: 1.19.3~511^2~6555^2~266 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0cce8ab97d614ef53970292bd403e7f4460d79f9;p=platform%2Fupstream%2Fgstreamer.git adder: be more graceful in the clipfunction Doing dynamic pipelines is hard in 0.10. As we don't have the sticky events in 0.10 and sending such events in special elements like adder and tee was outvoted on last attempt, be graceful to the misbehaviour instead. --- diff --git a/gst/adder/gstadder.c b/gst/adder/gstadder.c index 9c69717..3726f27 100644 --- a/gst/adder/gstadder.c +++ b/gst/adder/gstadder.c @@ -1016,8 +1016,14 @@ gst_adder_do_clip (GstCollectPads * pads, GstCollectData * data, { GstAdder *adder = GST_ADDER (user_data); - buffer = gst_audio_buffer_clip (buffer, &data->segment, adder->rate, - adder->bps); + /* in 0.10 the application might need to seek on newly added source-branches + * to make it send a newsegment, that is hard to sync and so the segment might + * not be initialized. Check this here to not trigger the assertion + */ + if (data->segment.format != GST_FORMAT_UNDEFINED) { + buffer = gst_audio_buffer_clip (buffer, &data->segment, adder->rate, + adder->bps); + } return buffer; }