From 1ab4e4b945c2f9d38150e93679517cb627938a84 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 10 Nov 2011 15:18:08 +0100 Subject: [PATCH] omxaudioenc: Make srcpad caps setting threadsafe --- omx/gstomxaudioenc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/omx/gstomxaudioenc.c b/omx/gstomxaudioenc.c index 14a2438..5062407 100644 --- a/omx/gstomxaudioenc.c +++ b/omx/gstomxaudioenc.c @@ -421,10 +421,12 @@ gst_omx_audio_enc_loop (GstOMXAudioEnc * self) GST_DEBUG_OBJECT (self, "Port settings have changed, updating caps"); + GST_BASE_AUDIO_ENCODER_STREAM_LOCK (self); caps = klass->get_caps (self, self->out_port, state); if (!caps) { if (buf) gst_omx_port_release_buffer (self->out_port, buf); + GST_BASE_AUDIO_ENCODER_STREAM_UNLOCK (self); goto caps_failed; } @@ -432,9 +434,11 @@ gst_omx_audio_enc_loop (GstOMXAudioEnc * self) gst_caps_unref (caps); if (buf) gst_omx_port_release_buffer (self->out_port, buf); + GST_BASE_AUDIO_ENCODER_STREAM_UNLOCK (self); goto caps_failed; } gst_caps_unref (caps); + GST_BASE_AUDIO_ENCODER_STREAM_UNLOCK (self); /* Now get a buffer */ if (acq_return != GST_OMX_ACQUIRE_BUFFER_OK) -- 2.7.4