summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorDoug Nazar <nazard@nazar.ca>2019-08-09 02:41:51 -0400
committerTim-Philipp Müller <tim@centricular.com>2019-08-14 18:39:47 +0100
commit58ea39c0be1feaf2734b95e52d8b5f2d4b4fc4b3 (patch)
tree7bd6984557d04d4e8fe0a3e8420a3f49a1c35cb1 /ext
parenta0c69c48d00bdefcaa2d3bb34f1f6c36e81cdb78 (diff)
downloadgstreamer-plugins-bad-58ea39c0be1feaf2734b95e52d8b5f2d4b4fc4b3.tar.gz
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.
Diffstat (limited to 'ext')
-rw-r--r--ext/soundtouch/gstpitch.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/soundtouch/gstpitch.cc b/ext/soundtouch/gstpitch.cc
index 4fbe0ab28..89bab3f07 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);