wasapi: added missing lock release in case of error in gst_wasapi_xxx_reset
authorSilvio Lazzeretti <silviola@amazon.com>
Wed, 15 Jul 2020 08:39:33 +0000 (10:39 +0200)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 15 Jul 2020 20:11:48 +0000 (20:11 +0000)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1440>

sys/wasapi/gstwasapisink.c
sys/wasapi/gstwasapisrc.c

index f631398a8bee1cd0f5882b09d534b2e5916deaa9..1d114a2d79e896e28ddcbdd9c12a4a34a7ae73b1 100644 (file)
@@ -746,11 +746,12 @@ gst_wasapi_sink_reset (GstAudioSink * asink)
 
   GST_OBJECT_LOCK (self);
   hr = IAudioClient_Stop (self->client);
-  HR_FAILED_AND (hr, IAudioClient::Stop,);
+  HR_FAILED_AND (hr, IAudioClient::Stop, goto err);
 
   hr = IAudioClient_Reset (self->client);
-  HR_FAILED_AND (hr, IAudioClient::Reset,);
+  HR_FAILED_AND (hr, IAudioClient::Reset, goto err);
 
+err:
   self->client_needs_restart = TRUE;
   GST_OBJECT_UNLOCK (self);
 }
index 92fd789ba697aa5f4f651fd3f302f58e9b09fefb..00364df621dc3df07bdcf69d1eda8dbbd6a519b7 100644 (file)
@@ -713,11 +713,12 @@ gst_wasapi_src_reset (GstAudioSrc * asrc)
 
   GST_OBJECT_LOCK (self);
   hr = IAudioClient_Stop (self->client);
-  HR_FAILED_RET (hr, IAudioClock::Stop,);
+  HR_FAILED_AND (hr, IAudioClock::Stop, goto err);
 
   hr = IAudioClient_Reset (self->client);
-  HR_FAILED_RET (hr, IAudioClock::Reset,);
+  HR_FAILED_AND (hr, IAudioClock::Reset, goto err);
 
+err:
   self->client_needs_restart = TRUE;
   GST_OBJECT_UNLOCK (self);
 }