audio: properly handle clipping of empty buffer

This commit is contained in:
Mark Nauwelaerts 2012-10-15 18:47:30 +02:00
parent d73dcb6af3
commit 162433795a

View file

@ -78,6 +78,10 @@ gst_audio_buffer_clip (GstBuffer * buffer, GstSegment * segment, gint rate,
trim = 0; trim = 0;
osize = size = gst_buffer_get_size (buffer); osize = size = gst_buffer_get_size (buffer);
/* no data, nothing to clip */
if (!size)
return buffer;
timestamp = GST_BUFFER_TIMESTAMP (buffer); timestamp = GST_BUFFER_TIMESTAMP (buffer);
GST_DEBUG ("timestamp %" GST_TIME_FORMAT, GST_TIME_ARGS (timestamp)); GST_DEBUG ("timestamp %" GST_TIME_FORMAT, GST_TIME_ARGS (timestamp));
if (GST_BUFFER_DURATION_IS_VALID (buffer)) { if (GST_BUFFER_DURATION_IS_VALID (buffer)) {