]> git.sesse.net Git - vlc/commitdiff
auhal: only request a audio output restart if the current playback device was removed...
authorFelix Paul Kühne <fkuehne@videolan.org>
Sat, 11 May 2013 17:09:15 +0000 (19:09 +0200)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sat, 11 May 2013 17:09:15 +0000 (19:09 +0200)
modules/audio_output/auhal.c

index 223c95151c28db387015dd15832eb4fc14add0d6..66340461dbef28c63e734688f1b17f92fe09f0c4 100644 (file)
@@ -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;
 }