@@ -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
289290void 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
0 commit comments