From 9740035f7056cdc18021b2cbd58ff80ecdb42112 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C3=ABl=20Carr=C3=A9?= Date: Mon, 24 Jun 2013 01:51:36 +0200 Subject: [PATCH] flac: don't overwrite bitspersample The decoder might have filters in place that cause it to output to something else than s16n Close: #6400 --- modules/codec/flac.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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, -- 2.39.2