Bug 7957 - VBRI header not read in MP3 files
: VBRI header not read in MP3 files
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Display
: 7.0
: PC Windows XP
: -- normal (vote)
: 7.x
Assigned To: Andy Grundman
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-23 14:18 UTC by Dan Evans
Modified: 2009-07-31 10:20 UTC (History)
2 users (show)

See Also:
Category: ---


Attachments
MP3 file's bitrate is displayed incorrectly as 160 CBR, when it's actually 243 VBR. (4.49 MB, application/octet-stream)
2008-04-23 14:20 UTC, Dan Evans
Details
read VBRI (1.96 KB, patch)
2008-04-23 16:42 UTC, KDF
Details | Diff
screencap (56.24 KB, image/jpeg)
2008-04-24 12:25 UTC, KDF
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Evans 2008-04-23 14:18:14 UTC
(support ref# 080422-000123)

Customer has his music ripped all in MP3 243kbps VBR.  While these files play fine, they are listed in SC and on the player as 160kbps CBR.

I got a test file and confirmed this is true.  SqueezeCenter reports it's a 160 CBR file.  Foobar2000 reports it's a 243 kbps VBR file.  MP3tag also reports it's a 243 kbps file.
Comment 1 Dan Evans 2008-04-23 14:20:11 UTC
Created attachment 3281 [details]
MP3 file's bitrate is displayed incorrectly as 160 CBR, when it's actually 243 VBR.
Comment 2 KDF 2008-04-23 16:08:23 UTC
problem is the VBR header is VBRI format, which MP3::Info doesn't appear to support.  

Details on header format can be found here:
http://www.codeproject.com/KB/audio-video/mpegaudioinfo.aspx
Comment 3 KDF 2008-04-23 16:42:07 UTC
Created attachment 3282 [details]
read VBRI
Comment 4 Spies Steven 2008-04-24 10:53:18 UTC
Thanks KDF!

Andy, is this a safe change for 7.0.1?
Comment 5 Andy Grundman 2008-04-24 11:40:07 UTC
Weird, I had not heard of VBRI before.  Thanks, will apply the patch.
Comment 6 KDF 2008-04-24 12:11:18 UTC
one more minor additional change to get the quality factor correctly (trivial really, since we don't make use of this info in SC):

Index: server/lib/MP3/Info.pm
===================================================================
--- server/lib/MP3/Info.pm	(revision 19132)
+++ server/lib/MP3/Info.pm	(working copy)
@@ -1830,7 +1830,7 @@
 		# start with quality factor at position 8
 		_vbr_seek($fh, \$off, \$bytes, 4);
 		_vbr_seek($fh, \$off, \$bytes, 2);
-		$vbr{scale} = _unpack_head($bytes);
+		$vbr{scale} = unpack('l', pack('L', unpack('n', $bytes)));
 
 		# Then Bytes, as position 10
 		_vbr_seek($fh, \$off, \$bytes);
Comment 7 KDF 2008-04-24 12:22:53 UTC
change 19133 has the fix for quality.  It all now matches that which is reported by the MPEG Audio Info tool from the codeproject site (interestingly, the tool can also report the bitrate of each frame.  Frame 1 shows where SC was getting the 160kbps CBR from).
Comment 8 KDF 2008-04-24 12:25:52 UTC
Created attachment 3287 [details]
screencap

and just for the record, a cap of the info shown from the mpeg audio tool.
Comment 9 Andy Grundman 2008-04-24 12:37:07 UTC
Fixed in change 19127.
Comment 10 Spies Steven 2008-05-06 14:17:13 UTC
Verified Fixed with SqueezeCenter Version: 7.0.1 - 19422
Comment 11 James Richardson 2008-05-15 12:31:00 UTC
This bug has recently been fixed in the latest release of SqueezeCenter 7.0.1

Please try that version, if you still see the error, then reopen this bug.

To download this version, please navigate to: http://www.slimdevices.com/su_downloads.html
Comment 12 Chris Owens 2009-07-31 10:20:01 UTC
Reduce number of active targets for SC