]> git.sesse.net Git - vlc/commitdiff
flac: don't overwrite bitspersample
authorRafaël Carré <funman@videolan.org>
Sun, 23 Jun 2013 23:51:36 +0000 (01:51 +0200)
committerRafaël Carré <funman@videolan.org>
Sun, 23 Jun 2013 23:53:16 +0000 (01:53 +0200)
The decoder might have filters in place that cause it to output to
something else than s16n

Close: #6400

modules/codec/flac.c

index 5568fcf155d35d9521029e5e8457b5b92a3f2ff6..1002ffd681b36c2043e6d3287e81bea08aaaad5e 100644 (file)
@@ -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,