From: Rafaël Carré Date: Sun, 23 Jun 2013 23:51:36 +0000 (+0200) Subject: flac: don't overwrite bitspersample X-Git-Tag: 2.1.0-git~27 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=9740035f7056cdc18021b2cbd58ff80ecdb42112;p=vlc flac: don't overwrite bitspersample The decoder might have filters in place that cause it to output to something else than s16n Close: #6400 --- diff --git a/modules/codec/flac.c b/modules/codec/flac.c index 5568fcf155..1002ffd681 100644 --- a/modules/codec/flac.c +++ b/modules/codec/flac.c @@ -233,8 +233,9 @@ static void DecoderMetadataCallback( const FLAC__StreamDecoder *decoder, p_dec->fmt_out.audio.i_physical_channels = p_dec->fmt_out.audio.i_original_channels = pi_channels_maps[metadata->data.stream_info.channels]; - p_dec->fmt_out.audio.i_bitspersample = - metadata->data.stream_info.bits_per_sample; + if (!p_dec->fmt_out.audio.i_bitspersample) + p_dec->fmt_out.audio.i_bitspersample = + metadata->data.stream_info.bits_per_sample; msg_Dbg( p_dec, "channels:%d samplerate:%d bitspersamples:%d", p_dec->fmt_out.audio.i_channels, p_dec->fmt_out.audio.i_rate,