зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1566389 - Store the parsed encoder delay and padding when demuxing an mp3 file. r=jya,bryce
Differential Revision: https://phabricator.services.mozilla.com/D91770
This commit is contained in:
Родитель
7d47c493a4
Коммит
5f704f19d4
|
@ -626,8 +626,17 @@ already_AddRefed<MediaRawData> MP3TrackDemuxer::GetNextFrame(
|
|||
if (mNumParsedFrames == 1) {
|
||||
// First frame parsed, let's read VBR info if available.
|
||||
BufferReader reader(frame->Data(), frame->Size());
|
||||
mParser.ParseVBRHeader(&reader);
|
||||
mFirstFrameOffset = frame->mOffset;
|
||||
|
||||
if (mParser.ParseVBRHeader(&reader)) {
|
||||
// Parsing was successful
|
||||
if (mParser.VBRInfo().Type() == FrameParser::VBRHeader::XING) {
|
||||
MP3LOGV("XING header present, skipping encoder delay (%u frames)",
|
||||
mParser.VBRInfo().EncoderDelay());
|
||||
mEncoderDelay = mParser.VBRInfo().EncoderDelay();
|
||||
mEncoderPadding = mParser.VBRInfo().EncoderPadding();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MP3LOGV("GetNext() End mOffset=%" PRIu64 " mNumParsedFrames=%" PRIu64
|
||||
|
|
|
@ -162,6 +162,11 @@ class MP3TrackDemuxer : public MediaTrackDemuxer,
|
|||
|
||||
// Audio track config info.
|
||||
UniquePtr<AudioInfo> mInfo;
|
||||
|
||||
// Number of frames to skip at the beginning
|
||||
uint32_t mEncoderDelay = 0;
|
||||
// Number of frames to skip at the end
|
||||
uint32_t mEncoderPadding = 0;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
Загрузка…
Ссылка в новой задаче