Bug 135459

Summary: [patch] incorrect calculation of mpeg duration
Product: [Frameworks and Libraries] taglib Reporter: Debajyoti Bera <dbera.web>
Component: generalAssignee: Scott Wheeler <wheeler>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: mpeg frame duration patch

Description Debajyoti Bera 2006-10-11 16:18:47 UTC
Version:           1.4 (svn) (using KDE KDE 3.5.4)
Installed from:    Compiled From Sources
OS:                Linux

(From taglib-devel mailing list entry:
http://mail.kde.org/pipermail/taglib-devel/2006-October/000513.html)

There are two major bugs in framelength computation and calculation time/frame for mpeg files.

For framelength, the formula is different for layer 1, 2 and 3 files. Taglib doesnt use separate formula for 2 and 3.
For calculation time/frame, mpeg 2 and 2.5 (LSF) have different blocksize than mpeg-1. Taglib doesnt take that into account.
These two bugs lead to incorrect calculation of frame duration.

I am attaching a patch fixing these. I based my calculations on lame(mpglib) source code and mpeg header information given in
http://www.codeproject.com/audio/mpegaudioinfo.asp
Comment 1 Debajyoti Bera 2006-10-11 16:20:42 UTC
Created attachment 18092 [details]
mpeg frame duration patch

Fix mpeg frame duration calculation.
Comment 2 Scott Wheeler 2006-10-11 16:21:56 UTC

*** This bug has been marked as a duplicate of 130625 ***