Commit 1640b684 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.
parent 231b08e8
......@@ -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 );
......
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