From d5a171cae9304df5405bf119d9af115d70ff17d3 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Thu, 27 Nov 2014 16:43:39 +0100 Subject: [PATCH] audiomixer: Do not try to resize a buffer to a negative size on EOS --- gst/audiomixer/gstaudiomixer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst/audiomixer/gstaudiomixer.c b/gst/audiomixer/gstaudiomixer.c index 41de0da737..2c56d7e557 100644 --- a/gst/audiomixer/gstaudiomixer.c +++ b/gst/audiomixer/gstaudiomixer.c @@ -1500,8 +1500,9 @@ gst_audiomixer_aggregate (GstAggregator * agg) "Last buffer is incomplete: %" G_GUINT64_FORMAT " <= %" G_GUINT64_FORMAT, max_offset, next_offset); next_offset = max_offset; + if (next_offset > audiomixer->offset) + gst_buffer_resize (outbuf, 0, (next_offset - audiomixer->offset) * bpf); - gst_buffer_resize (outbuf, 0, (next_offset - audiomixer->offset) * bpf); next_timestamp = gst_util_uint64_scale (next_offset, GST_SECOND, rate); } }