diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2016-11-30 10:43:50 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2016-11-30 10:43:50 +0200 |
commit | 71e819ae7dafb0077179ae7fa7a014c464811687 (patch) | |
tree | e3b4a9d92d0de2adfaa479b7ae124a3b84fb61d6 | |
parent | 1631a3864024a4a8b137b24906e2d76b94f2f47d (diff) |
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
-rw-r--r-- | gst-libs/gst/audio/audio-converter.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gst-libs/gst/audio/audio-converter.c b/gst-libs/gst/audio/audio-converter.c index 2d6ad7247..e4394c2df 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); |