[vlc-commits] waveout: copy ALSA fake hotplug code (fixes #8482)

Rémi Denis-Courmont git at videolan.org
Tue Apr 23 22:22:49 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Apr 23 23:22:30 2013 +0300| [ff0eb80a692eebbb19ccacb9abfeef5f14df4f67] | committer: Rémi Denis-Courmont

waveout: copy ALSA fake hotplug code (fixes #8482)

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

 modules/audio_output/waveout.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/modules/audio_output/waveout.c b/modules/audio_output/waveout.c
index 9a805a5..98bb9ab 100644
--- a/modules/audio_output/waveout.c
+++ b/modules/audio_output/waveout.c
@@ -795,6 +795,21 @@ static int Open(vlc_object_t *obj)
     vlc_mutex_init( &sys->lock );
     vlc_cond_init( &sys->cond );
 
+    /* WaveOut does not support hot-plug events so list devices at startup */
+    char **ids, **names;
+    int count = ReloadWaveoutDevices(VLC_OBJECT(aout), NULL, &ids, &names);
+    if (count >= 0)
+    {
+        for (int i = 0; i < count; i++)
+        {
+            aout_HotplugReport(aout, ids[i], names[i]);
+            free(names[i]);
+            free(ids[i]);
+        }
+        free(names);
+        free(ids);
+    }
+
     return VLC_SUCCESS;
 }
 



More information about the vlc-commits mailing list