[vlc-commits] aout: use S16N rather than S16L in audio outputs

Rémi Denis-Courmont git at videolan.org
Tue Dec 18 23:45:59 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Dec 19 00:45:11 2012 +0200| [bcd01c48635ac900c243fea6e47669db2e350393] | committer: Rémi Denis-Courmont

aout: use S16N rather than S16L in audio outputs

(In practice, all of these were only used in little endian anyway.)

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

 modules/audio_output/audioqueue.c       |    2 +-
 modules/audio_output/audiotrack.c       |    8 ++++----
 modules/audio_output/directx.c          |    6 +++---
 modules/audio_output/kai.c              |    4 ++--
 modules/audio_output/opensles_android.c |    4 ++--
 modules/audio_output/waveout.c          |    6 +++---
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/modules/audio_output/audioqueue.c b/modules/audio_output/audioqueue.c
index b67baeb..cc33c92 100644
--- a/modules/audio_output/audioqueue.c
+++ b/modules/audio_output/audioqueue.c
@@ -108,7 +108,7 @@ static int Start(audio_output_t *p_aout, audio_sample_format_t *restrict fmt)
     if (status != noErr)
         return VLC_EGENERIC;
 
-    fmt->i_format = VLC_CODEC_S16L;
+    fmt->i_format = VLC_CODEC_S16N;
     fmt->i_physical_channels = AOUT_CHANS_STEREO;
     fmt->i_rate = 44100;
     aout_FormatPrepare(fmt);
diff --git a/modules/audio_output/audiotrack.c b/modules/audio_output/audiotrack.c
index 5e76fa8..83858cf 100644
--- a/modules/audio_output/audiotrack.c
+++ b/modules/audio_output/audiotrack.c
@@ -239,10 +239,10 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
 
     stream_type = MUSIC;
 
-    /* We can only accept U8 and S16L */
-    if (fmt->i_format != VLC_CODEC_U8 && fmt->i_format != VLC_CODEC_S16L)
-        fmt->i_format = VLC_CODEC_S16L;
-    format = (fmt->i_format == VLC_CODEC_S16L) ? PCM_16_BIT : PCM_8_BIT;
+    /* We can only accept U8 and S16N */
+    if (fmt->i_format != VLC_CODEC_U8 && fmt->i_format != VLC_CODEC_S16N)
+        fmt->i_format = VLC_CODEC_S16N;
+    format = (fmt->i_format == VLC_CODEC_S16N) ? PCM_16_BIT : PCM_8_BIT;
 
     /* TODO: android supports more channels */
     fmt->i_original_channels = fmt->i_physical_channels;
diff --git a/modules/audio_output/directx.c b/modules/audio_output/directx.c
index 1c5c057..ae15bed 100644
--- a/modules/audio_output/directx.c
+++ b/modules/audio_output/directx.c
@@ -708,7 +708,7 @@ static int CreateDSBuffer( audio_output_t *p_aout, int i_format,
         waveformat.SubFormat = _KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
         break;
 
-    case VLC_CODEC_S16L:
+    case VLC_CODEC_S16N:
         waveformat.Format.wBitsPerSample = 16;
         waveformat.Samples.wValidBitsPerSample =
             waveformat.Format.wBitsPerSample;
@@ -816,7 +816,7 @@ static int CreateDSBufferPCM( audio_output_t *p_aout, vlc_fourcc_t *i_format,
                         (i_rate / 20) * 4 * i_nb_channels, b_probe )
         != VLC_SUCCESS )
     {
-        if ( CreateDSBuffer( p_aout, VLC_CODEC_S16L,
+        if ( CreateDSBuffer( p_aout, VLC_CODEC_S16N,
                              i_channels, i_nb_channels, i_rate,
                              (i_rate / 20) * 2 * i_nb_channels, b_probe )
              != VLC_SUCCESS )
@@ -825,7 +825,7 @@ static int CreateDSBufferPCM( audio_output_t *p_aout, vlc_fourcc_t *i_format,
         }
         else
         {
-            *i_format = VLC_CODEC_S16L;
+            *i_format = VLC_CODEC_S16N;
             return VLC_SUCCESS;
         }
     }
diff --git a/modules/audio_output/kai.c b/modules/audio_output/kai.c
index e2298af..f5b0446 100644
--- a/modules/audio_output/kai.c
+++ b/modules/audio_output/kai.c
@@ -149,8 +149,8 @@ static int Start ( audio_output_t *p_aout, audio_sample_format_t *fmt )
             = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT;
     }
 
-    /* Support s16l only */
-    format.i_format = VLC_CODEC_S16L;
+    /* Support S16 only */
+    format.i_format = VLC_CODEC_S16N;
 
     aout_FormatPrepare( &format );
 
diff --git a/modules/audio_output/opensles_android.c b/modules/audio_output/opensles_android.c
index 147d44a..dd2438e 100644
--- a/modules/audio_output/opensles_android.c
+++ b/modules/audio_output/opensles_android.c
@@ -448,8 +448,8 @@ static int Start( audio_output_t *p_aout, audio_sample_format_t *restrict fmt )
     p_sys->p_buffer_chain = NULL;
     p_sys->pp_buffer_last = &p_sys->p_buffer_chain;
 
-    // we want 16bit signed data little endian.
-    fmt->i_format              = VLC_CODEC_S16L;
+    // we want 16bit signed data native endian.
+    fmt->i_format              = VLC_CODEC_S16N;
     fmt->i_physical_channels   = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT;
     p_aout->play               = Play;
     p_aout->pause              = Pause;
diff --git a/modules/audio_output/waveout.c b/modules/audio_output/waveout.c
index 424ffd1..8c9b79d 100644
--- a/modules/audio_output/waveout.c
+++ b/modules/audio_output/waveout.c
@@ -575,7 +575,7 @@ static int OpenWaveOut( audio_output_t *p_aout, uint32_t i_device_id, int i_form
         waveformat.SubFormat = __KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
         break;
 
-    case VLC_CODEC_S16L:
+    case VLC_CODEC_S16N:
         waveformat.Format.wBitsPerSample = 16;
         waveformat.Samples.wValidBitsPerSample =
             waveformat.Format.wBitsPerSample;
@@ -675,7 +675,7 @@ static int OpenWaveOutPCM( audio_output_t *p_aout, uint32_t i_device_id,
                                    i_channels, i_nb_channels, i_rate, b_probe )
         != VLC_SUCCESS )
     {
-        if ( OpenWaveOut( p_aout, i_device_id, VLC_CODEC_S16L,
+        if ( OpenWaveOut( p_aout, i_device_id, VLC_CODEC_S16N,
                           i_channels, i_nb_channels, i_rate, b_probe )
              != VLC_SUCCESS )
         {
@@ -683,7 +683,7 @@ static int OpenWaveOutPCM( audio_output_t *p_aout, uint32_t i_device_id,
         }
         else
         {
-            *i_format = VLC_CODEC_S16L;
+            *i_format = VLC_CODEC_S16N;
             return VLC_SUCCESS;
         }
     }



More information about the vlc-commits mailing list