[FFmpeg-devel] [PATCH] Ac3/AAC parser: remove incomplete first frames
Justin Ruggles
justin.ruggles
Mon Jan 25 00:56:24 CET 2010
Reimar D?ffinger wrote:
> On Sun, Jan 24, 2010 at 05:13:53PM -0500, Justin Ruggles wrote:
>>>> For AC-3, if the partial frame is out of sync, the decoder will
>>>> print/return a frame sync error and skip the partial frame. If it is
>>>> synced but only partial (e.g. truncated stream) it will decode any
>>>> complete blocks and use use error concealment for the truncated blocks.
>>> I can't really see where the code would check for being in sync?
>> ac3dec.c:1237
>> err = parse_frame_header(s);
>> ...
>> switch(err) {
>> case AAC_AC3_PARSE_ERROR_SYNC:
>> av_log(avctx, AV_LOG_ERROR, "frame sync error\n");
>> return -1;
>
> That can't work, this error value will be overwritten by the frame size check.
You're right. The frame size check should only be done if the header is
valid. Fixed in SVN.
Thanks,
Justin
More information about the ffmpeg-devel
mailing list