[FFmpeg-devel] [PATCH] Detect DNET/byte-swapped AC-3 and support decoding it directly.

Reimar Döffinger Reimar.Doeffinger
Sat Mar 5 17:20:23 CET 2011

On Sat, Mar 05, 2011 at 11:10:24AM -0500, Justin Ruggles wrote:
> This will only work if avctx->error_recognition >= FF_ER_CAREFUL because
> otherwise s->input_buffer is not allocated and the original buffer is
> used directly.
> We could move the allocation from ac3_decode_init() to
> ac3_decode_frame() based on both error_recognition and detection of
> byte-swapped header.

I'll send an updated patch, however I think that code is completely
The only reason for that copy as I understand it is to avoid a crash.
I don't consider it reasonable for a codec to crash.
That is not to mention that it seems nonsense to depend on
error_recognition, this has nothing at all to do with whether
errors are recognized, I would suspect this is a leftover from
the time when this was called error_resilience and it meaning was misunderstood.

More information about the ffmpeg-devel mailing list