Bug 1100913 - Fix incorrect playback of MSE with HE-AAC audio streams. r=cajbir

This commit is contained in:
Jean-Yves Avenard 2014-11-18 23:23:00 +11:00
parent 5d9ea3e8c0
commit f76301c128
2 changed files with 24 additions and 0 deletions

View File

@ -642,6 +642,29 @@ MediaSourceReader::ReadMetadata(MediaInfo* aInfo, MetadataTags** aTags)
return NS_OK;
}
void
MediaSourceReader::ReadUpdatedMetadata(MediaInfo* aInfo)
{
if (mAudioTrack) {
MOZ_ASSERT(mAudioTrack->IsReady());
mAudioReader = mAudioTrack->Decoders()[0]->GetReader();
const MediaInfo& info = mAudioReader->GetMediaInfo();
MOZ_ASSERT(info.HasAudio());
mInfo.mAudio = info.mAudio;
}
if (mVideoTrack) {
MOZ_ASSERT(mVideoTrack->IsReady());
mVideoReader = mVideoTrack->Decoders()[0]->GetReader();
const MediaInfo& info = mVideoReader->GetMediaInfo();
MOZ_ASSERT(info.HasVideo());
mInfo.mVideo = info.mVideo;
}
*aInfo = mInfo;
}
void
MediaSourceReader::Ended()
{

View File

@ -84,6 +84,7 @@ public:
bool IsMediaSeekable() { return true; }
nsresult ReadMetadata(MediaInfo* aInfo, MetadataTags** aTags) MOZ_OVERRIDE;
void ReadUpdatedMetadata(MediaInfo* aInfo) MOZ_OVERRIDE;
void Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime,
int64_t aCurrentTime) MOZ_OVERRIDE;