From 12a992ae2a6e97c6509151b725f1b7ed126adc72 Mon Sep 17 00:00:00 2001 From: PacketVideo CM Date: Thu, 29 Oct 2009 12:05:36 -0700 Subject: [PATCH] RIO-7523: Modifying clip durations computation in MP3 parser --- engines/2way/src/pv_2way_sdkinfo.h | 2 +- engines/author/src/pv_author_sdkinfo.h | 2 +- engines/player/src/pv_player_sdkinfo.h | 2 +- fileformats/mp3/parser/src/mp3parser.cpp | 8 +++++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/engines/2way/src/pv_2way_sdkinfo.h b/engines/2way/src/pv_2way_sdkinfo.h index 7333ec2b..403c06f2 100644 --- a/engines/2way/src/pv_2way_sdkinfo.h +++ b/engines/2way/src/pv_2way_sdkinfo.h @@ -21,7 +21,7 @@ // This header file is automatically generated at build-time // *** OFFICIAL RELEASE INFO -- Will not auto update -#define PV2WAY_ENGINE_SDKINFO_LABEL "1038824" +#define PV2WAY_ENGINE_SDKINFO_LABEL "1039074" #define PV2WAY_ENGINE_SDKINFO_DATE 0x20091023 #endif //PV_2WAY_SDKINFO_H_INCLUDED diff --git a/engines/author/src/pv_author_sdkinfo.h b/engines/author/src/pv_author_sdkinfo.h index 332bae51..54b85cf2 100644 --- a/engines/author/src/pv_author_sdkinfo.h +++ b/engines/author/src/pv_author_sdkinfo.h @@ -21,7 +21,7 @@ // This header file is automatically generated at build-time // *** OFFICIAL RELEASE INFO -- Will not auto update -#define PVAUTHOR_ENGINE_SDKINFO_LABEL "1038824" +#define PVAUTHOR_ENGINE_SDKINFO_LABEL "1039074" #define PVAUTHOR_ENGINE_SDKINFO_DATE 0x20091023 #endif //PV_AUTHOR_SDKINFO_H_INCLUDED diff --git a/engines/player/src/pv_player_sdkinfo.h b/engines/player/src/pv_player_sdkinfo.h index 86e661aa..6e9748aa 100644 --- a/engines/player/src/pv_player_sdkinfo.h +++ b/engines/player/src/pv_player_sdkinfo.h @@ -21,7 +21,7 @@ // This header file is automatically generated at build-time // *** OFFICIAL RELEASE INFO -- Will not auto update -#define PVPLAYER_ENGINE_SDKINFO_LABEL "1038824" +#define PVPLAYER_ENGINE_SDKINFO_LABEL "1039074" #define PVPLAYER_ENGINE_SDKINFO_DATE 0x20091023 #endif //PV_PLAYER_SDKINFO_H_INCLUDED diff --git a/fileformats/mp3/parser/src/mp3parser.cpp b/fileformats/mp3/parser/src/mp3parser.cpp index 72dd7233..6da0c211 100644 --- a/fileformats/mp3/parser/src/mp3parser.cpp +++ b/fileformats/mp3/parser/src/mp3parser.cpp @@ -2954,13 +2954,15 @@ void MP3Parser::GetDurationFromCompleteScan(uint32 &aClipDuration) aClipDuration = iClipDurationComputed; return; } + uint32 samplesPerFrame = spfIndexTable[iMP3HeaderInfo.frameVer][iMP3HeaderInfo.layerID]; + uint32 samplingRate = srIndexTable[((iMP3HeaderInfo.frameVer)*4) + iMP3HeaderInfo.srIndex]; + OsclFloat samplingRateinKHz = (OsclFloat)samplingRate / 1000; - // Just assign the iScanTimestamp to the ClipDuration. iScanTimestamp is made up after adding all - // frameDurations of the frames which are scanned as a part of DurationCalculator AO. - iClipDurationComputed = iScanTimestamp; + iClipDurationComputed = (uint32)(iScannedFrameCount * (OsclFloat)(samplesPerFrame / samplingRateinKHz)); aClipDuration = iClipDurationComputed; } + void MP3Parser::FillTOCTable(uint32 aFilePos, uint32 aTimeStampToFrame) { if (iDurationScanComplete) -- 2.11.0