Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
[RIO-7802] MP3 duration is not calculated when there is a CPM plugin
  • Loading branch information
Sahil Sachdeva committed Oct 28, 2009
1 parent bc4e504 commit dceaa51
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions fileformats/mp3/parser/src/mp3parser.cpp
Expand Up @@ -438,7 +438,7 @@ MP3ErrorType MP3Parser::ParseMP3File(PVFile * fpUsed, bool aEnableCRC)
// SAVE THE CURRENT FILE POSITION
errCode = MP3Utils::SeektoOffset(fp, 0, Oscl_File::SEEKSET);
// try to retrieve the file size
if (fp->GetCPM() == NULL && MP3Utils::getCurrentFileSize(fp, iLocalFileSize))
if (fp->GetFileBufferingCapacity() == 0 && MP3Utils::getCurrentFileSize(fp, iLocalFileSize))
{
iLocalFileSizeSet = true;
iInitSearchFileSize = OSCL_MIN(iInitSearchFileSize, iLocalFileSize);
Expand Down Expand Up @@ -758,7 +758,7 @@ MP3ErrorType MP3Parser::ScanMP3File(PVFile * fpUsed, uint32 aFramesToScan)

if (fpUsed->Read(pFrameHeader, 1, MP3_FRAME_HEADER_SIZE) != MP3_FRAME_HEADER_SIZE)
{
if (fpUsed->GetCPM() == NULL)
if (fpUsed->GetFileBufferingCapacity() == 0)
{
iDurationScanComplete = true;
}
Expand Down Expand Up @@ -1362,7 +1362,7 @@ uint32 MP3Parser::GetDuration(bool aMetadataDuration)
uint32 clipDuration = 0;

// local clip playback
if (!fp->GetCPM())
if (fp->GetFileBufferingCapacity() == 0)
{
// if scanning is complete, send the clip duration from scan
// else if vbri/xing headers exist send duration from that
Expand Down Expand Up @@ -1795,7 +1795,7 @@ uint32 MP3Parser::SeekToTimestamp(uint32 timestampInMsec)
{
uint32 SeekPosition = 0;
SeekPosition = SeekPointFromTimestamp(timestampInMsec);
if (!((!fp->GetCPM()) && (SeekPosition == iLocalFileSize) && (timestampInMsec == iClipDurationInMsec)))
if (!((fp->GetFileBufferingCapacity() == 0) && (SeekPosition == iLocalFileSize) && (timestampInMsec == iClipDurationInMsec)))
{
SeekPosition += StartOffset;
}
Expand Down Expand Up @@ -1926,7 +1926,7 @@ uint32 MP3Parser::SeekPointFromTimestamp(uint32 &timestamp)
* calculated on the basis of average bit rate
**/
int32 avgBR = 0;
if (fp->GetCPM())
if (fp->GetFileBufferingCapacity() > 0)
{
avgBR = iAvgBitrateInbps;
}
Expand All @@ -1950,7 +1950,7 @@ uint32 MP3Parser::SeekPointFromTimestamp(uint32 &timestamp)
* Since in PD/PS scenarios we might not be having enough data to find the seek point
* We can find the seek point when we are resuming the playback
**/
if (seekPoint > 0 && !fp->GetCPM())
if (seekPoint > 0 && fp->GetFileBufferingCapacity() == 0)
{
// seek to the reposition point location
MP3Utils::SeektoOffset(fp, seekPoint + StartOffset, Oscl_File::SEEKSET);
Expand Down Expand Up @@ -2015,7 +2015,7 @@ MP3ErrorType MP3Parser::mp3FindSync(uint32 seekPoint, uint32 &syncOffset, PVFile
syncOffset = 0;
iMaxSyncBufferSize = 627; /* default for 192 kbps, 44.1 kHz */

if (aFile->GetCPM() != NULL)
if (aFile->GetFileBufferingCapacity() > 0)
{
iLocalFileSizeSet = (int32)MP3Utils::getCurrentFileSize(aFile, iLocalFileSize);
}
Expand Down

0 comments on commit dceaa51

Please sign in to comment.