[FFmpeg-devel] [PATCH] Ac3/AAC parser: remove incomplete first frames

Justin Ruggles justin.ruggles
Sun Jan 24 22:43:51 CET 2010

Reimar D?ffinger wrote:

> Hello,
> this is what causes decode errors and annoying sounds after seeking.
> The following patch has one annoyance: if there is a frame starting
> right at position 0 it will still return a 0-sized frame initially
> (and claim to have consumed 0 bytes).
> But now that I can say for sure that the problem is there maybe
> someone will fix it properly (or I'll threaten to apply this).

I thought that parsers are not supposed to discard anything.  The AC-3
parser used to discard partial frames, but it was changed to send them
to the decoder.

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 don't know why there would be "annoying sounds" after seeking.  Maybe
there is data left in the parser buffer?  Do you have a sample I could
test?  Is this happening with ffplay?


More information about the ffmpeg-devel mailing list