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.
This commit is contained in:
Stefan Sauer 2011-12-01 11:59:17 +01:00
parent 3c87d7dc77
commit 0cce8ab97d

View file

@ -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;
}