Bug 130755 - Info about samples per frame in MPEG::Header
Summary: Info about samples per frame in MPEG::Header
Status: RESOLVED FIXED
Alias: None
Product: taglib
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Scott Wheeler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-13 10:13 UTC by Dirk E. Wagner
Modified: 2008-01-31 21:55 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk E. Wagner 2006-07-13 10:13:45 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:                Linux

For play time calculation the number of samples per frame is necessary. It would be usefull to have a method  MPEG::Header::samplesPerFrame() which returns the number of samples per frame. The functionality can be implemented by adding:

1. Add a private member samplesPerFrame in MPEG::Header::HeaderPrivate

2. Add getter in mpegheader.cpp 

int MPEG::Header::samplesPerFrame() const
{
  return d->samplesPerFrame;
}

3. Add following statements in MPEG::Header::parse()

static const int samplesPerFrameArray[3][4] = {
// MPEG 1, MPEG 2 (LSF), MPEG 2.5 (LSF)
 {  384,  384,  384,	0 }, // Layer I
 { 1152, 1152, 1152,	0 }, // Layer II
 { 1152,  576,  576, 0 }  // Layer III
};

d->samplesPerFrame = samplesPerFrameArray[d->layer-1][d->version];
Comment 1 Scott Wheeler 2008-01-31 21:55:53 UTC
SVN commit 769207 by wheeler:

Meh, why not go ahead and expose this.  Add a method to get the samples per frame.

FEATURE:130755


 M  +19 -1     mpegheader.cpp  
 M  +5 -0      mpegheader.h  
 M  +2 -10     mpegproperties.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=769207