[vlc-commits] auhal: unlock mutex in stream listener error paths

David Fuhrmann git at videolan.org
Mon Feb 24 15:28:21 CET 2014


vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Sun Feb 23 19:17:09 2014 +0100| [b81200fba9d8d9f8c93ef15ae451dbf529f2f409] | committer: David Fuhrmann

auhal: unlock mutex in stream listener error paths

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b81200fba9d8d9f8c93ef15ae451dbf529f2f409
---

 modules/audio_output/auhal.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c
index cb5c07b..3078c1a 100644
--- a/modules/audio_output/auhal.c
+++ b/modules/audio_output/auhal.c
@@ -1497,18 +1497,22 @@ static OSStatus StreamsChangedListener(AudioObjectID inObjectID,  UInt32 inNumbe
     AudioObjectPropertyAddress streamsAddress = { kAudioDevicePropertyStreams, kAudioDevicePropertyScopeOutput, kAudioObjectPropertyElementMaster };
     err = AudioObjectGetPropertyDataSize(p_sys->i_selected_dev, &streamsAddress, 0, NULL, &i_param_size);
     if (err != noErr) {
-        msg_Err(p_aout, "could not get number of streams [%4.4s]", (char *)&err);
+        msg_Err(p_aout, "could not get number of streams for device %i [%4.4s]", p_sys->i_selected_dev, (char *)&err);
+        vlc_mutex_unlock(&p_sys->var_lock);
         return VLC_EGENERIC;
     }
 
     i_streams = i_param_size / sizeof(AudioStreamID);
     p_streams = (AudioStreamID *)malloc(i_param_size);
-    if (p_streams == NULL)
+    if (p_streams == NULL) {
+        vlc_mutex_unlock(&p_sys->var_lock);
         return VLC_ENOMEM;
+    }
 
     err = AudioObjectGetPropertyData(p_sys->i_selected_dev, &streamsAddress, 0, NULL, &i_param_size, p_streams);
     if (err != noErr) {
         msg_Err(p_aout, "could not get list of streams [%4.4s]", (char *)&err);
+        vlc_mutex_unlock(&p_sys->var_lock);
         return VLC_EGENERIC;
     }
     vlc_mutex_unlock(&p_sys->var_lock);



More information about the vlc-commits mailing list