When I remove these check form "libavformat/mmf.c" then ma-3/5/7 samples decodes, but sample rate (and channels count for stereo files) is identified incorrectly.
/* Tag = "ATRx", where "x" = track number */
- if ((tag & 0xffffff) == MKTAG('M', 'T', 'R', 0)) {
- av_log(s, AV_LOG_ERROR, "MIDI like format found, unsupported\n");
- return -1;
- }
- if ((tag & 0xffffff) != MKTAG('A', 'T', 'R', 0)) {
- av_log(s, AV_LOG_ERROR, "Unsupported SMAF chunk %08x\n", tag);
- return -1;
- }
/* Make sure it's followed by an Awa chunk, aka wave data */
- if ((tag & 0xffffff) != MKTAG('A', 'w', 'a', 0)) {
- av_log(s, AV_LOG_ERROR, "Unexpected SMAF chunk %08x\n", tag);
- return -1;
C:\>ffmpeg -i ma3.mmf
ffmpeg version N-46755-ge70144c Copyright (c) 2000-2012 the FFmpeg developers
built on Nov 15 2012 02:38:20 with gcc 4.5.0 (GCC) 20100414 (Fedora MinGW 4.5.
0-1.fc14)
configuration: --prefix=/var/www/users/research/ffmpeg/snapshots/build --arch=
x86 --target-os=mingw32 --cross-prefix=i686-pc-mingw32- --cc='ccache i686-pc-min
gw32-gcc' --enable-w32threads --enable-memalign-hack --enable-runtime-cpudetect
--enable-cross-compile --enable-static --disable-shared --extra-libs='-lws2_32 -
lwinmm -lpthread' --extra-cflags='--static -I/var/www/users/research/ffmpeg/snap
shots/build/include' --extra-ldflags='-static -L/var/www/users/research/ffmpeg/s
napshots/build/lib' --enable-bzlib --enable-zlib --enable-gpl --enable-version3
--enable-nonfree --enable-libx264 --enable-libspeex --enable-libtheora --enable-
libvorbis --enable-libfaac --enable-libxvid --enable-libopencore-amrnb --enable-
libopencore-amrwb --enable-libmp3lame --enable-libvpx --disable-decoder=libvpx
libavutil 52. 6.100 / 52. 6.100
libavcodec 54. 71.100 / 54. 71.100
libavformat 54. 36.100 / 54. 36.100
libavdevice 54. 3.100 / 54. 3.100
libavfilter 3. 23.100 / 3. 23.100
libswscale 2. 1.102 / 2. 1.102
libswresample 0. 16.100 / 0. 16.100
libpostproc 52. 1.100 / 52. 1.100
[mmf @ 0x1edc280] MIDI like format found, unsupported
ma3.mmf: Operation not permitted
I attached also the real mmf midi files.