summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/codecs/on2/h264dec/SoftAVC.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2011-11-09 10:26:06 -0800
committerAndreas Huber <andih@google.com>2011-11-09 10:26:06 -0800
commit2961a85f5f00343c115ac8e5dc17de631694fb6e (patch)
treed63ced935a4f2ab3e6d02072481825f81fb65227 /media/libstagefright/codecs/on2/h264dec/SoftAVC.cpp
parent936a981ba15d528a023311aa32f46446813551d9 (diff)
downloadframeworks_av-2961a85f5f00343c115ac8e5dc17de631694fb6e.zip
frameworks_av-2961a85f5f00343c115ac8e5dc17de631694fb6e.tar.gz
frameworks_av-2961a85f5f00343c115ac8e5dc17de631694fb6e.tar.bz2
There's no point in trying to continue to decode after an error was signalled.
Change-Id: I2a2410cac9444eadd85be5d104799703171f1a24 related-to-bug: 5588658
Diffstat (limited to 'media/libstagefright/codecs/on2/h264dec/SoftAVC.cpp')
-rw-r--r--media/libstagefright/codecs/on2/h264dec/SoftAVC.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/media/libstagefright/codecs/on2/h264dec/SoftAVC.cpp b/media/libstagefright/codecs/on2/h264dec/SoftAVC.cpp
index 740c957..dede3ac 100644
--- a/media/libstagefright/codecs/on2/h264dec/SoftAVC.cpp
+++ b/media/libstagefright/codecs/on2/h264dec/SoftAVC.cpp
@@ -76,7 +76,8 @@ SoftAVC::SoftAVC(
mPicId(0),
mHeadersDecoded(false),
mEOSStatus(INPUT_DATA_AVAILABLE),
- mOutputPortSettingsChange(NONE) {
+ mOutputPortSettingsChange(NONE),
+ mSignalledError(false) {
initPorts();
CHECK_EQ(initDecoder(), (status_t)OK);
}
@@ -287,7 +288,7 @@ OMX_ERRORTYPE SoftAVC::getConfig(
}
void SoftAVC::onQueueFilled(OMX_U32 portIndex) {
- if (mOutputPortSettingsChange != NONE) {
+ if (mSignalledError || mOutputPortSettingsChange != NONE) {
return;
}
@@ -298,7 +299,6 @@ void SoftAVC::onQueueFilled(OMX_U32 portIndex) {
List<BufferInfo *> &inQueue = getPortQueue(kInputPortIndex);
List<BufferInfo *> &outQueue = getPortQueue(kOutputPortIndex);
H264SwDecRet ret = H264SWDEC_PIC_RDY;
- status_t err = OK;
bool portSettingsChanged = false;
while ((mEOSStatus != INPUT_DATA_AVAILABLE || !inQueue.empty())
&& outQueue.size() == kNumOutputBuffers) {
@@ -372,7 +372,12 @@ void SoftAVC::onQueueFilled(OMX_U32 portIndex) {
inPicture.dataLen = 0;
if (ret < 0) {
LOGE("Decoder failed: %d", ret);
- err = ERROR_MALFORMED;
+
+ notify(OMX_EventError, OMX_ErrorUndefined,
+ ERROR_MALFORMED, NULL);
+
+ mSignalledError = true;
+ return;
}
}
}
@@ -400,10 +405,6 @@ void SoftAVC::onQueueFilled(OMX_U32 portIndex) {
uint8_t *data = (uint8_t *) decodedPicture.pOutputPicture;
drainOneOutputBuffer(picId, data);
}
-
- if (err != OK) {
- notify(OMX_EventError, OMX_ErrorUndefined, err, NULL);
- }
}
}