[vlc-commits] Wave Microsoft formats: avoid to redefine things twice

Jean-Baptiste Kempf git at videolan.org
Sat Sep 21 00:02:48 CEST 2013


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Sep 20 23:42:34 2013 +0200| [c857bce3841c9265e2049c1007409c7b18735283] | committer: Jean-Baptiste Kempf

Wave Microsoft formats: avoid to redefine things twice

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

 include/vlc_codecs.h                        |   10 ++++++----
 modules/audio_output/waveout.c              |    2 +-
 modules/audio_output/windows_audio_common.h |   27 +--------------------------
 3 files changed, 8 insertions(+), 31 deletions(-)

diff --git a/include/vlc_codecs.h b/include/vlc_codecs.h
index 2c8d47e..7655d9e 100644
--- a/include/vlc_codecs.h
+++ b/include/vlc_codecs.h
@@ -79,11 +79,13 @@ ATTR_PACKED
 _WAVEFORMATEXTENSIBLE {
     WAVEFORMATEX Format;
     union {
-        uint16_t wValidBitsPerSample;
-        uint16_t wSamplesPerBlock;
-        uint16_t wReserved;
+        uint16_t wValidBitsPerSample;       /* bits of precision  */
+        uint16_t wSamplesPerBlock;          /* valid if wBitsPerSample==0 */
+        uint16_t wReserved;                 /* If neither applies, set to zero. */
     } Samples;
-    uint32_t     dwChannelMask;
+
+    uint32_t     dwChannelMask;             /* Channels present */
+
     GUID SubFormat;
 } WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE;
 #endif /* _WAVEFORMATEXTENSIBLE_ */
diff --git a/modules/audio_output/waveout.c b/modules/audio_output/waveout.c
index 13c0f1e..1292512 100644
--- a/modules/audio_output/waveout.c
+++ b/modules/audio_output/waveout.c
@@ -505,7 +505,7 @@ static int OpenWaveOut( audio_output_t *p_aout, uint32_t i_device_id, int i_form
                  waveformat.Samples.wValidBitsPerSample);
         msg_Dbg( p_aout,"waveformat.Samples.wSamplesPerBlock = %d",
                  waveformat.Samples.wSamplesPerBlock);
-        msg_Dbg( p_aout,"waveformat.dwChannelMask          = %lx",
+        msg_Dbg( p_aout,"waveformat.dwChannelMask          = %u",
                  waveformat.dwChannelMask);
     }
 
diff --git a/modules/audio_output/windows_audio_common.h b/modules/audio_output/windows_audio_common.h
index 64f5897..167710d 100644
--- a/modules/audio_output/windows_audio_common.h
+++ b/modules/audio_output/windows_audio_common.h
@@ -34,17 +34,7 @@
 #define INITGUID /* Doesn't define the DEFINE_GUID as extern */
 #include <initguid.h>
 
-#ifndef WAVE_FORMAT_IEEE_FLOAT
-#   define WAVE_FORMAT_IEEE_FLOAT 0x0003
-#endif
-
-#ifndef WAVE_FORMAT_DOLBY_AC3_SPDIF
-#   define WAVE_FORMAT_DOLBY_AC3_SPDIF 0x0092
-#endif
-
-#ifndef WAVE_FORMAT_EXTENSIBLE
-#define  WAVE_FORMAT_EXTENSIBLE   0xFFFE
-#endif
+#include <vlc_codecs.h>
 
 DEFINE_GUID( _KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, WAVE_FORMAT_IEEE_FLOAT, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 );
 DEFINE_GUID( _KSDATAFORMAT_SUBTYPE_PCM, WAVE_FORMAT_PCM, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 );
@@ -54,23 +44,8 @@ static const GUID __KSDATAFORMAT_SUBTYPE_IEEE_FLOAT = {WAVE_FORMAT_IEEE_FLOAT, 0
 static const GUID __KSDATAFORMAT_SUBTYPE_PCM = {WAVE_FORMAT_PCM, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
 static const GUID __KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF = {WAVE_FORMAT_DOLBY_AC3_SPDIF, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
 
-
 #define FRAMES_NUM 8                                      /* Needs to be > 3 */
 
-#ifndef _WAVEFORMATEXTENSIBLE_
-typedef struct {
-    WAVEFORMATEX    Format;
-    union {
-        WORD wValidBitsPerSample;       /* bits of precision  */
-        WORD wSamplesPerBlock;          /* valid if wBitsPerSample==0 */
-        WORD wReserved;                 /* If neither applies, set to zero. */
-    } Samples;
-    DWORD           dwChannelMask;      /* which channels are */
-                                        /* present in stream  */
-    GUID            SubFormat;
-} WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE;
-#endif
-
 #include <dsound.h>
 
 #ifndef SPEAKER_FRONT_LEFT



More information about the vlc-commits mailing list