Bug 1016148 - Ensure we mark IMFSamples after a flush as discontinuities, so that A/V sync works after seek in MP4Reader. r=padenot

This commit is contained in:
Chris Pearce 2014-07-10 09:25:14 +12:00
Родитель 02da3c08a5
Коммит 88803f036e
2 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -21,6 +21,7 @@ namespace mozilla {
MFTDecoder::MFTDecoder()
: mMFTProvidesOutputSamples(false)
, mDiscontinuity(true)
{
memset(&mInputStreamInfo, 0, sizeof(MFT_INPUT_STREAM_INFO));
memset(&mOutputStreamInfo, 0, sizeof(MFT_OUTPUT_STREAM_INFO));
@ -237,6 +238,11 @@ MFTDecoder::Output(RefPtr<IMFSample>* aOutput)
MOZ_ASSERT(output.pSample);
if (mDiscontinuity) {
output.pSample->SetUINT32(MFSampleExtension_Discontinuity, TRUE);
mDiscontinuity = false;
}
*aOutput = output.pSample; // AddRefs
if (mMFTProvidesOutputSamples) {
// If the MFT is providing samples, we must release the sample here.
@ -277,6 +283,8 @@ MFTDecoder::Flush()
HRESULT hr = SendMFTMessage(MFT_MESSAGE_COMMAND_FLUSH, 0);
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
mDiscontinuity = true;
return S_OK;
}

Просмотреть файл

@ -96,6 +96,9 @@ private:
// True if the IMFTransform allocates the samples that it returns.
bool mMFTProvidesOutputSamples;
// True if we need to mark the next sample as a discontinuity.
bool mDiscontinuity;
};
} // namespace mozilla