mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 05:30:29 +00:00
Bug 1288329: [ogg/vorbis] P2. Pass extra information to the decoder so that it can perform proper trimmer. r=gerald,jwwang
The OggReader always passed a complete ogg_packet to the vorbis decoder, ensuring that the right number of frames was be returned. In the conversion to the new architecture, this information got lost making the vorbis decoder always return more frames than normal on the last packet. MozReview-Commit-ID: HYHxqXfYntJ --HG-- extra : rebase_source : 3d2a59b011ec1e996ab7aaf29e16baa495f7d31c
This commit is contained in:
parent
49ac56ce9a
commit
5d0a764769
@ -512,6 +512,7 @@ MediaRawData::Clone() const
|
||||
s->mExtraData = mExtraData;
|
||||
s->mCryptoInternal = mCryptoInternal;
|
||||
s->mTrackInfo = mTrackInfo;
|
||||
s->mEOS = mEOS;
|
||||
if (!s->mBuffer.Append(mBuffer.Data(), mBuffer.Length())) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -656,6 +656,10 @@ public:
|
||||
const CryptoSample& mCrypto;
|
||||
RefPtr<MediaByteBuffer> mExtraData;
|
||||
|
||||
// Used by the Vorbis decoder and Ogg demuxer.
|
||||
// Indicates that this is the last packet of the stream.
|
||||
bool mEOS = false;
|
||||
|
||||
RefPtr<SharedTrackInfo> mTrackInfo;
|
||||
|
||||
// Return a deep copy or nullptr if out of memory.
|
||||
|
@ -247,6 +247,7 @@ OggCodecState::PacketOutAsMediaRawData()
|
||||
sample->mTime = end_tstamp - duration;
|
||||
sample->mDuration = duration;
|
||||
sample->mKeyframe = IsKeyframe(packet);
|
||||
sample->mEOS = packet->e_o_s;
|
||||
|
||||
ReleasePacket(packet);
|
||||
|
||||
|
@ -167,7 +167,8 @@ VorbisDataDecoder::DoDecode(MediaRawData* aSample)
|
||||
mLastFrameTime = Some(aSample->mTime);
|
||||
}
|
||||
|
||||
ogg_packet pkt = InitVorbisPacket(aData, aLength, false, false, -1, mPacketCount++);
|
||||
ogg_packet pkt = InitVorbisPacket(aData, aLength, false, aSample->mEOS,
|
||||
aSample->mTimecode, mPacketCount++);
|
||||
|
||||
if (vorbis_synthesis(&mVorbisBlock, &pkt) != 0) {
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user