[vlc-commits] auhal: only request a audio output restart if the current playback device was removed (close #8556)

Felix Paul Kühne git at videolan.org
Sat May 11 19:11:07 CEST 2013


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sat May 11 19:09:15 2013 +0200| [2b0891bbb3ccc17d12ae7f79bb012382996693d2] | committer: Felix Paul Kühne

auhal: only request a audio output restart if the current playback device was removed (close #8556)

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

 modules/audio_output/auhal.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c
index 223c951..6634046 100644
--- a/modules/audio_output/auhal.c
+++ b/modules/audio_output/auhal.c
@@ -1195,6 +1195,9 @@ static void RebuildDeviceList(audio_output_t * p_aout)
     p_sys->device_list = CFArrayCreateCopy(kCFAllocatorDefault, currentListOfDevices);
     CFRelease(currentListOfDevices);
 
+    if(!CFArrayContainsValue(p_sys->device_list, CFRangeMake(0, CFArrayGetCount(p_sys->device_list)),CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &p_sys->i_selected_dev)))
+        aout_RestartRequest(p_aout, AOUT_RESTART_OUTPUT);
+
     free(deviceIDs);
 }
 
@@ -1491,7 +1494,6 @@ static OSStatus HardwareListener(AudioObjectID inObjectID,  UInt32 inNumberAddre
     }
 
     RebuildDeviceList(p_aout);
-    aout_RestartRequest(p_aout, AOUT_RESTART_OUTPUT);
 
     return err;
 }



More information about the vlc-commits mailing list