mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 884654 - Fix deadlock come from OmxDecoder::statusChanged(). r=doublec
This commit is contained in:
parent
e0b09909b4
commit
e6911a901b
@ -8,6 +8,7 @@
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include <cutils/properties.h>
|
||||
#include <stagefright/foundation/ADebug.h>
|
||||
#include <stagefright/foundation/AMessage.h>
|
||||
#include <stagefright/MediaExtractor.h>
|
||||
#include <stagefright/MetaData.h>
|
||||
@ -174,8 +175,10 @@ OmxDecoder::~OmxDecoder()
|
||||
|
||||
void OmxDecoder::statusChanged()
|
||||
{
|
||||
mozilla::ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
|
||||
mDecoder->GetReentrantMonitor().NotifyAll();
|
||||
sp<AMessage> notify =
|
||||
new AMessage(kNotifyStatusChanged, mReflector->id());
|
||||
// post AMessage to OmxDecoder via ALooper.
|
||||
notify->post();
|
||||
}
|
||||
|
||||
static sp<IOMX> sOMX = nullptr;
|
||||
@ -765,12 +768,28 @@ void OmxDecoder::Pause()
|
||||
// Called on ALooper thread.
|
||||
void OmxDecoder::onMessageReceived(const sp<AMessage> &msg)
|
||||
{
|
||||
Mutex::Autolock autoLock(mSeekLock);
|
||||
switch (msg->what()) {
|
||||
case kNotifyPostReleaseVideoBuffer:
|
||||
{
|
||||
Mutex::Autolock autoLock(mSeekLock);
|
||||
// Free pending video buffers when OmxDecoder is not seeking video.
|
||||
// If OmxDecoder is seeking video, the buffers are freed on seek exit.
|
||||
if (!mIsVideoSeeking) {
|
||||
ReleaseAllPendingVideoBuffersLocked();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Free pending video buffers when OmxDecoder is not seeking video.
|
||||
// If OmxDecoder is in seeking video, the buffers are freed on seek exit.
|
||||
if (mIsVideoSeeking != true) {
|
||||
ReleaseAllPendingVideoBuffersLocked();
|
||||
case kNotifyStatusChanged:
|
||||
{
|
||||
mozilla::ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
|
||||
mDecoder->GetReentrantMonitor().NotifyAll();
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
TRESPASS();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,8 @@ class OmxDecoder : public OMXCodecProxy::EventListener {
|
||||
};
|
||||
|
||||
enum {
|
||||
kNotifyPostReleaseVideoBuffer = 'noti'
|
||||
kNotifyPostReleaseVideoBuffer = 'noti',
|
||||
kNotifyStatusChanged = 'stat'
|
||||
};
|
||||
|
||||
AbstractMediaDecoder *mDecoder;
|
||||
|
Loading…
Reference in New Issue
Block a user