mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-08 03:32:18 +00:00
wasapi: added missing lock release in case of error in gst_wasapi_xxx_reset
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1440>
This commit is contained in:
parent
e6944da134
commit
3803fa29b2
2 changed files with 6 additions and 4 deletions
|
@ -746,11 +746,12 @@ gst_wasapi_sink_reset (GstAudioSink * asink)
|
||||||
|
|
||||||
GST_OBJECT_LOCK (self);
|
GST_OBJECT_LOCK (self);
|
||||||
hr = IAudioClient_Stop (self->client);
|
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 = IAudioClient_Reset (self->client);
|
||||||
HR_FAILED_AND (hr, IAudioClient::Reset,);
|
HR_FAILED_AND (hr, IAudioClient::Reset, goto err);
|
||||||
|
|
||||||
|
err:
|
||||||
self->client_needs_restart = TRUE;
|
self->client_needs_restart = TRUE;
|
||||||
GST_OBJECT_UNLOCK (self);
|
GST_OBJECT_UNLOCK (self);
|
||||||
}
|
}
|
||||||
|
|
|
@ -713,11 +713,12 @@ gst_wasapi_src_reset (GstAudioSrc * asrc)
|
||||||
|
|
||||||
GST_OBJECT_LOCK (self);
|
GST_OBJECT_LOCK (self);
|
||||||
hr = IAudioClient_Stop (self->client);
|
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 = IAudioClient_Reset (self->client);
|
||||||
HR_FAILED_RET (hr, IAudioClock::Reset,);
|
HR_FAILED_AND (hr, IAudioClock::Reset, goto err);
|
||||||
|
|
||||||
|
err:
|
||||||
self->client_needs_restart = TRUE;
|
self->client_needs_restart = TRUE;
|
||||||
GST_OBJECT_UNLOCK (self);
|
GST_OBJECT_UNLOCK (self);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue