Commit 57bb2b9a authored by Rémi Denis-Courmont's avatar 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)
parent 6fbf4cb7
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_aout.h> #include <vlc_aout.h>
#include <vlc_cpu.h>
#include "dummy.h" #include "dummy.h"
...@@ -52,16 +53,17 @@ int OpenAudio ( vlc_object_t * p_this ) ...@@ -52,16 +53,17 @@ int OpenAudio ( vlc_object_t * p_this )
p_aout->output.pf_play = Play; p_aout->output.pf_play = Play;
aout_VolumeSoftInit( p_aout ); 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.i_nb_samples = A52_FRAME_NB;
p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE; p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
p_aout->output.output.i_frame_length = A52_FRAME_NB; p_aout->output.output.i_frame_length = A52_FRAME_NB;
} }
else else
{ p_aout->output.output.i_format =
p_aout->output.i_nb_samples = FRAME_SIZE; HAVE_FPU ? VLC_CODEC_FL32 : VLC_CODEC_S16N;
}
/* Create the variable for the audio-device */ /* Create the variable for the audio-device */
var_Create( p_aout, "audio-device", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE ); var_Create( p_aout, "audio-device", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment