mbox series

[FFmpeg-devel,v4,0/1] avformat: add mca demuxer

Message ID 20200903223237.111724-1-liushuyu@aosc.io
Headers show
Series avformat: add mca demuxer | expand


liushuyu@aosc.io Sept. 3, 2020, 10:32 p.m. UTC
From: liushuyu <liushuyu@aosc.io>

This patch adds the MCA demuxer to FFmpeg.

MCA is a format used by Capcom in some of their games, the audio format
is always ADPCM_THP_LE in these files.

This MCA demuxer implementation currently supports MCA version 1-5 and
can partially handle some of the version 5 files with minor damages to
the file header.

There are some sample files I have prepared that you can try:

* (version 4) https://streams.videolan.org/ffmpeg/incoming/bgm18_1632b.mca
* (version 5) https://streams.videolan.org/ffmpeg/incoming/bgm020_1632.mca

N.B. Files using version 1 to 3 are harder to find, I don't seem to find
any to test.

As required by
https://ffmpeg.org/developer.html#New-codecs-or-formats-checklist, the
minor version of libavformat is updated to 52.

Patch version 2 changes:

* changed version field to uint16_t and remove redundant compares

Patch version 3 changes:

* dropped excessive comments about offsets
* removed redundant headers
* indentation fixes and paddings around '='
* aliased st->codecpar to par to shorten the code
* made m->samples_per_block zero check earlier
* m->coef_offset converted to a local variable
* replaced avio_read() checks with ffio_read_size()
* moved sample size check to read_header()
* manual sample copying replaced with av_get_packet()

Patch version 4 changes

* check version early in the probe()
* removed redundant av_new_packet() call
* libavformat minor version updated to 54

Zixing Liu (1):
  avformat: add mca demuxer

 Changelog                |   1 +
 doc/general.texi         |   2 +
 libavformat/Makefile     |   1 +
 libavformat/allformats.c |   1 +
 libavformat/mca.c        | 226 +++++++++++++++++++++++++++++++++++++++
 libavformat/version.h    |   2 +-
 6 files changed, 232 insertions(+), 1 deletion(-)
 create mode 100644 libavformat/mca.c