[vlc-commits] Dummy: select a sane sample format

Rémi Denis-Courmont git at videolan.org
Fri May 13 22:24:23 CEST 2011


vlc/vlc-1.1 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri May 13 23:17:58 2011 +0300| [57bb2b9ab4c726bd127bdee12152a5cb36054ded] | committer: Rémi Denis-Courmont

Dummy: select a sane sample format

We need to select a format that can be output by the mixer, preferably
the exact format output by the mixer. Keeping the input audio format
breaks for non-linear input formats when S/PDIF output is disabled:
the mixer outputs FL32 that cannot be converted to MPGA, AC-3, etc.
(cherry picked from commit 1640b6840ac8d6f08b527950b6e30b9035bbe6fe)

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

 modules/misc/dummy/aout.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/modules/misc/dummy/aout.c b/modules/misc/dummy/aout.c
index e988e19..981107f 100644
--- a/modules/misc/dummy/aout.c
+++ b/modules/misc/dummy/aout.c
@@ -31,6 +31,7 @@
 
 #include <vlc_common.h>
 #include <vlc_aout.h>
+#include <vlc_cpu.h>
 
 #include "dummy.h"
 
@@ -52,16 +53,17 @@ int OpenAudio ( vlc_object_t * p_this )
     p_aout->output.pf_play = Play;
     aout_VolumeSoftInit( p_aout );
 
-    if ( p_aout->output.output.i_format == VLC_CODEC_SPDIFL )
+    if( AOUT_FMT_NON_LINEAR( &p_aout->output.output )
+     && var_InheritBool( p_this, "spdif" ) )
     {
+        p_aout->output.output.i_format = VLC_CODEC_SPDIFL;
         p_aout->output.i_nb_samples = A52_FRAME_NB;
         p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
         p_aout->output.output.i_frame_length = A52_FRAME_NB;
     }
     else
-    {
-        p_aout->output.i_nb_samples = FRAME_SIZE;
-    }
+        p_aout->output.output.i_format =
+            HAVE_FPU ? VLC_CODEC_FL32 : VLC_CODEC_S16N;
 
     /* Create the variable for the audio-device */
     var_Create( p_aout, "audio-device", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );



More information about the vlc-commits mailing list