From: Doug Nazar Date: Fri, 9 Aug 2019 06:41:51 +0000 (-0400) Subject: pitch: Fix race between putSamples() and setting soundtouch parameters X-Git-Tag: accepted/tizen/unified/20220217.153506~2^2~10^2~9^2~12^2~2^2~90^2~1^2~47 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=58ea39c0be1feaf2734b95e52d8b5f2d4b4fc4b3;p=platform%2Fupstream%2Fgstreamer.git pitch: Fix race between putSamples() and setting soundtouch parameters The various soundtouch set*() functions may cause buffer (re)allocations which interferes with inputting the audio data. --- diff --git a/ext/soundtouch/gstpitch.cc b/ext/soundtouch/gstpitch.cc index 4fbe0ab..89bab3f 100644 --- a/ext/soundtouch/gstpitch.cc +++ b/ext/soundtouch/gstpitch.cc @@ -876,7 +876,9 @@ gst_pitch_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) } gst_buffer_map (buffer, &info, GST_MAP_READ); + GST_OBJECT_LOCK (pitch); priv->st->putSamples ((soundtouch::SAMPLETYPE *) info.data, info.size / pitch->info.bpf); + GST_OBJECT_UNLOCK (pitch); gst_buffer_unmap (buffer, &info); gst_buffer_unref (buffer);