changeset 35375:15b6ae10180a

Fix bitrate calculation for FLAC files.
author reimar
date Sun, 25 Nov 2012 11:37:52 +0000
parents 8249c2131cd3
children 02006c5b3b30
files libmpdemux/demux_audio.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_audio.c	Sat Nov 24 15:54:22 2012 +0000
+++ b/libmpdemux/demux_audio.c	Sun Nov 25 11:37:52 2012 +0000
@@ -603,8 +603,9 @@
 	      int32_t srate;
 	      stream_skip(s, 14);
 	      srate = stream_read_int24(s) >> 4;
-	      num_samples  = (uint64_t)stream_read_int24(s) << 16;
-	      num_samples |= stream_read_word(s);
+	      num_samples  = stream_read_char(s) & 0xf;
+	      num_samples <<= 32;
+	      num_samples |= stream_read_dword(s);
 	      if (num_samples && srate)
 	        sh_audio->i_bps = size * srate / num_samples;
 	    }