[vlc-commits] flac: don't overwrite bitspersample

Rafaël Carré git at videolan.org
Mon Jun 24 01:52:36 CEST 2013


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Mon Jun 24 01:51:36 2013 +0200| [e0c953707e809710fe73112b885d4bbad75ddc1d] | committer: Rafaël Carré

flac: don't overwrite bitspersample

The decoder might have filters in place that cause it to output to
something else than s16n

Close: #6476

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

 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 5568fcf..1002ffd 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,



More information about the vlc-commits mailing list