提交 4be1e1df 编写于 作者: J Justin Ruggles

mpegaudiodec: Skip only bad frames instead of the whole packet.

On frame decoding failure, return an error if the frame is the same size as
the whole packet, otherwise just log an error message and return the number
of bytes consumed.
上级 15946eb8
...@@ -1819,8 +1819,15 @@ static int decode_frame(AVCodecContext * avctx, ...@@ -1819,8 +1819,15 @@ static int decode_frame(AVCodecContext * avctx,
*data_size = out_size; *data_size = out_size;
avctx->sample_rate = s->sample_rate; avctx->sample_rate = s->sample_rate;
//FIXME maybe move the other codec info stuff from above here too //FIXME maybe move the other codec info stuff from above here too
}else } else {
av_log(avctx, AV_LOG_DEBUG, "Error while decoding MPEG audio frame.\n"); //FIXME return -1 / but also return the number of bytes consumed av_log(avctx, AV_LOG_ERROR, "Error while decoding MPEG audio frame.\n");
/* Only return an error if the bad frame makes up the whole packet.
If there is more data in the packet, just consume the bad frame
instead of returning an error, which would discard the whole
packet. */
if (buf_size == avpkt->size)
return out_size;
}
s->frame_size = 0; s->frame_size = 0;
return buf_size; return buf_size;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册