From 3803fa29b2d403593c67219a980e01c9fa85bcae Mon Sep 17 00:00:00 2001 From: Silvio Lazzeretti Date: Wed, 15 Jul 2020 10:39:33 +0200 Subject: [PATCH] wasapi: added missing lock release in case of error in gst_wasapi_xxx_reset Part-of: --- sys/wasapi/gstwasapisink.c | 5 +++-- sys/wasapi/gstwasapisrc.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/wasapi/gstwasapisink.c b/sys/wasapi/gstwasapisink.c index f631398a8b..1d114a2d79 100644 --- a/sys/wasapi/gstwasapisink.c +++ b/sys/wasapi/gstwasapisink.c @@ -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); } diff --git a/sys/wasapi/gstwasapisrc.c b/sys/wasapi/gstwasapisrc.c index 92fd789ba6..00364df621 100644 --- a/sys/wasapi/gstwasapisrc.c +++ b/sys/wasapi/gstwasapisrc.c @@ -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); } -- 2.34.1