From 71e819ae7dafb0077179ae7fa7a014c464811687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 30 Nov 2016 10:43:50 +0200 Subject: [PATCH] audio-converter: In passthrough, also don't copy if in and out block are the same In and out array are usually different, they are stack allocated arrays. However the blocks inside them still can be the same. https://bugzilla.gnome.org/show_bug.cgi?id=775369 --- gst-libs/gst/audio/audio-converter.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/audio/audio-converter.c b/gst-libs/gst/audio/audio-converter.c index 2d6ad72476..e4394c2df3 100644 --- a/gst-libs/gst/audio/audio-converter.c +++ b/gst-libs/gst/audio/audio-converter.c @@ -851,8 +851,14 @@ converter_passthrough (GstAudioConverter * convert, bytes = samples * (convert->in.bpf / convert->in.channels); - for (i = 0; i < chain->blocks; i++) + for (i = 0; i < chain->blocks; i++) { + if (out[i] == in[i]) { + g_assert (convert->in_place); + continue; + } + memcpy (out[i], in[i], bytes); + } } else { for (i = 0; i < chain->blocks; i++) gst_audio_format_fill_silence (convert->in.finfo, out[i], samples);