Skip to content

Commit 3f99d95

Browse files
committed
There's no point in trying to continue to decode after an error was signalled.
Change-Id: I2a2410cac9444eadd85be5d104799703171f1a24 related-to-bug: 5588658
1 parent b78ae75 commit 3f99d95

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

media/libstagefright/codecs/on2/h264dec/SoftAVC.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ SoftAVC::SoftAVC(
7676
mPicId(0),
7777
mHeadersDecoded(false),
7878
mEOSStatus(INPUT_DATA_AVAILABLE),
79-
mOutputPortSettingsChange(NONE) {
79+
mOutputPortSettingsChange(NONE),
80+
mSignalledError(false) {
8081
initPorts();
8182
CHECK_EQ(initDecoder(), (status_t)OK);
8283
}
@@ -287,7 +288,7 @@ OMX_ERRORTYPE SoftAVC::getConfig(
287288
}
288289

289290
void SoftAVC::onQueueFilled(OMX_U32 portIndex) {
290-
if (mOutputPortSettingsChange != NONE) {
291+
if (mSignalledError || mOutputPortSettingsChange != NONE) {
291292
return;
292293
}
293294

@@ -298,7 +299,6 @@ void SoftAVC::onQueueFilled(OMX_U32 portIndex) {
298299
List<BufferInfo *> &inQueue = getPortQueue(kInputPortIndex);
299300
List<BufferInfo *> &outQueue = getPortQueue(kOutputPortIndex);
300301
H264SwDecRet ret = H264SWDEC_PIC_RDY;
301-
status_t err = OK;
302302
bool portSettingsChanged = false;
303303
while ((mEOSStatus != INPUT_DATA_AVAILABLE || !inQueue.empty())
304304
&& outQueue.size() == kNumOutputBuffers) {
@@ -372,7 +372,12 @@ void SoftAVC::onQueueFilled(OMX_U32 portIndex) {
372372
inPicture.dataLen = 0;
373373
if (ret < 0) {
374374
LOGE("Decoder failed: %d", ret);
375-
err = ERROR_MALFORMED;
375+
376+
notify(OMX_EventError, OMX_ErrorUndefined,
377+
ERROR_MALFORMED, NULL);
378+
379+
mSignalledError = true;
380+
return;
376381
}
377382
}
378383
}
@@ -400,10 +405,6 @@ void SoftAVC::onQueueFilled(OMX_U32 portIndex) {
400405
uint8_t *data = (uint8_t *) decodedPicture.pOutputPicture;
401406
drainOneOutputBuffer(picId, data);
402407
}
403-
404-
if (err != OK) {
405-
notify(OMX_EventError, OMX_ErrorUndefined, err, NULL);
406-
}
407408
}
408409
}
409410

media/libstagefright/codecs/on2/h264dec/SoftAVC.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ struct SoftAVC : public SimpleSoftOMXComponent {
8888
};
8989
OutputPortSettingChange mOutputPortSettingsChange;
9090

91+
bool mSignalledError;
92+
9193
void initPorts();
9294
status_t initDecoder();
9395
void updatePortDefinitions();

0 commit comments

Comments
 (0)