[MPlayer-users] wrong length and bitrate with FLAC

Ilja Sekler ilja_sekler_ at gmx.de
Thu Nov 22 15:32:53 CET 2012


Am 21.11.2012 21:35, schrieb Ilja Sekler:

> Am 16.11.2012 20:35, schrieb wbrana:
> 
>> MPlayer 1.1 returns correct values
>> 
>> ID_AUDIO_BITRATE=1018008
>> ID_LENGTH=277.00
>> 
>> but revision 35421 returns wrong values
>> 
>> ID_AUDIO_BITRATE=8
>> ID_LENGTH=35330017.00
> 
> 
> Already r35368 got the bitrate and thus the length of FLAC files wrong.
> The bug is still there in MPlayer as of r35437, a fix would be highly
> appreciated. [...]

This is a regression from r35333, verified by bisect:

svn log -v -r 35333
------------------------------------------------------------------------
r35333 | reimar | 2012-11-01 23:22:04 +0100 (Thu, 01 Nov 2012) | 2 lines
Changed paths:
   M /trunk/libmpdemux/demux_audio.c

Add cast to ensure shift will not overflow.

------------------------------------------------------------------------


svn diff -r 35333:35332
Index: libmpdemux/demux_audio.c
===================================================================
--- libmpdemux/demux_audio.c	(Revision 35333)
+++ libmpdemux/demux_audio.c	(Revision 35332)
@@ -605,7 +605,7 @@
 	      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_int24(s) << 16;
 	      num_samples |= stream_read_word(s);
 	      if (num_samples && srate)
 	        sh_audio->i_bps = size * srate / num_samples;


Thanks,

-- 
Regards

Ilja


More information about the MPlayer-users mailing list