[vlc-commits] auhal: pretend to support audio device switching for demo purposes

Felix Paul Kühne git at videolan.org
Thu Jan 24 14:21:26 CET 2013


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Thu Jan 24 14:19:01 2013 +0100| [ece191985bb09c316c18c65fc4fd45d28ea6a472] | committer: Felix Paul Kühne

auhal: pretend to support audio device switching for demo purposes

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

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

diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c
index dba1401..c094c1d 100644
--- a/modules/audio_output/auhal.c
+++ b/modules/audio_output/auhal.c
@@ -909,9 +909,12 @@ static int DeviceList(audio_output_t *p_aout, char ***namesp, char ***descsp)
     *namesp = names = xmalloc(sizeof(*names) * n);
     *descsp = descs = xmalloc(sizeof(*descs) * n);
 
+    char deviceid[100];
     for (struct audio_device_t *device = p_sys->devices; device != NULL; device = device->next) {
-        *(names++) = strdup(device->name);
-        sprintf(*(descs++), "%d", device->deviceid);
+        sprintf(deviceid, "%i", device->deviceid);
+        *(names++) = strdup(deviceid);
+        msg_Dbg(p_aout, "using device id %s", deviceid);
+        *(descs++) = strdup(device->name);
     }
 
     msg_Dbg(p_aout, "returning a list of %i devices", n);
@@ -1040,6 +1043,8 @@ static int SwitchAudioDevice(audio_output_t *p_aout, const char *name)
 {
     msg_Warn(p_aout, "we should switch to device '%s'", name);
 
+    aout_DeviceReport(p_aout, name);
+
     return 0;
 }
 



More information about the vlc-commits mailing list