зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
02da3c08a5
Коммит
88803f036e
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче