mov: Refactor codec id selection in mov_codec_id
mov: Refactor video specific parsing in mov_parse_stsd_video
mov: Refactor audio specific parsing in mov_parse_stsd_audio
mov: Refactor subtitle specific parsing in mov_parse_stsd_subtitle
mov: Refactor codec specific final steps in mov_finalize_stsd_codec
mov: Refactor multiple stsd skipping in mov_mov_skip_multiple_stsd
mov: Parse tmcd extradata
mov: Write tmcd extradata
twinvq: set block align for codecs and use it in size checks

This both allows factoring out size check for both MetaSound and TwinVQ-VQF
decoders and fixes the situation when there are several MetaSound frames
stuffed together (that happens in 8kHz @ 8kbps MetaSound in ASF for example).
imc: support mode 1
movenc: Check for allocation failures in mov_create_chapter_track

Signed-off-by: Martin Storsjö <martin@martin.st>
movenc: Check that tracks->enc exists before trying to free extradata

Signed-off-by: Martin Storsjö <martin@martin.st>
movenc: Properly free allocated data on failures in mov_write_header

Signed-off-by: Martin Storsjö <martin@martin.st>
movenc: Check for errors from mov_create_chapter_track

On failures in the write_trailer function, we could also ignore
the errors and try to finish the file despite these errors (which
would only leave an incomplete chapters track). It's probably better
to signal the error clearly to the caller though (and if this
function failed there's no guarantee that there's enough memory to
finish the trailer either).

Signed-off-by: Martin Storsjö <martin@martin.st>
matroskaenc: Fix writing TRACKDEFAULTFLAG

The element was only being written when the value == 1.  But the default
value of this element is 1, so this has no useful effect.  This element
needs to be written when the value == 0.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
doc: Document the flv demuxer
flv: Fix the help string
ac3: Do not clash with normal AVERROR

The parsing function return AVERROR and AAC_AC3_PARSE_ERROR values,
make sure they are not misunderstood.
ac3: Clean up the error paths
ac3: Return proper error codes