[vlc-commits] wasapi: improve format negotiation

Rémi Denis-Courmont git at videolan.org
Wed May 16 18:46:44 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed May 16 19:16:39 2012 +0300| [e6e801c38abe882429cbfc7f8380f32597b470d0] | committer: Rémi Denis-Courmont

wasapi: improve format negotiation

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

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

diff --git a/modules/audio_output/wasapi.c b/modules/audio_output/wasapi.c
index b4fcf66..4bd232e 100644
--- a/modules/audio_output/wasapi.c
+++ b/modules/audio_output/wasapi.c
@@ -166,22 +166,21 @@ static void vlc_ToWave(WAVEFORMATEXTENSIBLE *restrict wf,
 {
     switch (audio->i_format)
     {
-#if 0
-        case VLC_CODEC_FL32:
         case VLC_CODEC_FL64:
+            audio->i_format = VLC_CODEC_FL32;
+        case VLC_CODEC_FL32:
             wf->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
             break;
 
         case VLC_CODEC_S8:
+        case VLC_CODEC_U8:
+            audio->i_format = VLC_CODEC_S16N;
         case VLC_CODEC_S16N:
-        case VLC_CODEC_S24N:
-        case VLC_CODEC_S32N:
             wf->SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
             break;
-#endif
+
         default:
             audio->i_format = VLC_CODEC_FL32;
-            audio->i_rate = 48000;
             wf->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
             break;
      }
@@ -297,7 +296,7 @@ static int Open(vlc_object_t *obj)
         return VLC_EGENERIC;
     }
 
-    /* Select audio device */
+    /* Get audio device according to policy */
     IMMDeviceEnumerator *devs;
     hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL,
                           &IID_IMMDeviceEnumerator, (void **)&devs);
@@ -307,7 +306,6 @@ static int Open(vlc_object_t *obj)
         goto error;
     }
 
-    /* TODO: support selecting a device from config? */
     IMMDevice *dev;
     hr = IMMDeviceEnumerator_GetDefaultAudioEndpoint(devs, eRender,
                                                      eConsole, &dev);



More information about the vlc-commits mailing list