[vlc-commits] mmdevice: don't lock read of sys->dev
Thomas Guillem
git at videolan.org
Wed Feb 21 08:17:15 CET 2018
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Feb 21 08:08:18 2018 +0100| [9f671c24e9d7275071b2d6d8be0b756cd134cbe5] | committer: Thomas Guillem
mmdevice: don't lock read of sys->dev
sys->dev can't be changed (unless requested by the current thread) from the MMSession thread here.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9f671c24e9d7275071b2d6d8be0b756cd134cbe5
---
modules/audio_output/mmdevice.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/modules/audio_output/mmdevice.c b/modules/audio_output/mmdevice.c
index 2e3fdb30ab..731474848b 100644
--- a/modules/audio_output/mmdevice.c
+++ b/modules/audio_output/mmdevice.c
@@ -1081,6 +1081,9 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
{
aout_sys_t *sys = aout->sys;
+ if (sys->dev == NULL)
+ return -1;
+
const bool b_spdif = AOUT_FMT_SPDIF(fmt);
const bool b_hdmi = AOUT_FMT_HDMI(fmt);
if (b_spdif || b_hdmi)
@@ -1108,14 +1111,6 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
EnterMTA();
EnterCriticalSection(&sys->lock);
-
- if (sys->dev == NULL)
- {
- LeaveCriticalSection(&sys->lock);
- LeaveMTA();
- return -1;
- }
-
for (;;)
{
char *modlist = var_InheritString(aout, "mmdevice-backend");
More information about the vlc-commits
mailing list