mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1140995 - part 2: Don't send the audio/video data when the EOS flag is raised because the decoded data is invalid. r=cpearce
This commit is contained in:
parent
10c2275eec
commit
7c2b98b83d
@ -426,8 +426,11 @@ MediaCodecReader::DecodeAudioDataSync()
|
||||
}
|
||||
}
|
||||
|
||||
if (bufferInfo.mBuffer != nullptr && bufferInfo.mSize > 0 &&
|
||||
bufferInfo.mBuffer->data() != nullptr) {
|
||||
if ((bufferInfo.mFlags & MediaCodec::BUFFER_FLAG_EOS) ||
|
||||
(status == ERROR_END_OF_STREAM)) {
|
||||
AudioQueue().Finish();
|
||||
} else if (bufferInfo.mBuffer != nullptr && bufferInfo.mSize > 0 &&
|
||||
bufferInfo.mBuffer->data() != nullptr) {
|
||||
// This is the approximate byte position in the stream.
|
||||
int64_t pos = mDecoder->GetResource()->Tell();
|
||||
|
||||
@ -445,13 +448,7 @@ MediaCodecReader::DecodeAudioDataSync()
|
||||
bufferInfo.mSize,
|
||||
mInfo.mAudio.mChannels));
|
||||
}
|
||||
|
||||
if ((bufferInfo.mFlags & MediaCodec::BUFFER_FLAG_EOS) ||
|
||||
(status == ERROR_END_OF_STREAM)) {
|
||||
AudioQueue().Finish();
|
||||
}
|
||||
mAudioTrack.mCodec->releaseOutputBuffer(bufferInfo.mIndex);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
@ -918,6 +915,13 @@ MediaCodecReader::DecodeVideoFrameSync(int64_t aTimeThreshold)
|
||||
}
|
||||
}
|
||||
|
||||
if ((bufferInfo.mFlags & MediaCodec::BUFFER_FLAG_EOS) ||
|
||||
(status == ERROR_END_OF_STREAM)) {
|
||||
VideoQueue().Finish();
|
||||
mVideoTrack.mCodec->releaseOutputBuffer(bufferInfo.mIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
nsRefPtr<VideoData> v;
|
||||
RefPtr<TextureClient> textureClient;
|
||||
sp<GraphicBuffer> graphicBuffer;
|
||||
@ -1014,11 +1018,6 @@ MediaCodecReader::DecodeVideoFrameSync(int64_t aTimeThreshold)
|
||||
}
|
||||
}
|
||||
|
||||
if ((bufferInfo.mFlags & MediaCodec::BUFFER_FLAG_EOS) ||
|
||||
(status == ERROR_END_OF_STREAM)) {
|
||||
VideoQueue().Finish();
|
||||
}
|
||||
|
||||
if (v != nullptr && textureClient != nullptr && graphicBuffer != nullptr) {
|
||||
MutexAutoLock al(mTextureClientIndexesLock);
|
||||
mTextureClientIndexes.Put(textureClient.get(), bufferInfo.mIndex);
|
||||
|
Loading…
Reference in New Issue
Block a user