[FFmpeg-devel] [PATCH/DRAFT] MonkeyAudio Demuxer/Decoder

Måns Rullgård mans
Wed Jun 20 09:36:46 CEST 2007

"Benjamin Zores" <ben at geexbox.org> writes:

> Hi there,
> As recently stated on Kostya's blog, a light GPL (plain C) decoder has
> been written by Dave Chapman for Rockbox project.
> I've started porting it to FFMpeg to have a native demuxer/decoder for
> this audio format.
> Good news is that demuxer seems _almost_ okay by now.
> Not so bad news is that decoder seems to work a bit: it decodes a few
> samples (too slow however) but then crashes before the end of the
> first frame, and here's where I need a few help.
> Well, first thing that bugs me is that MonkeyAudio uses really HUUUUGE frames.
> Though, I redefined the following in avcodec.h:
> -#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
> +#define AVCODEC_MAX_AUDIO_FRAME_SIZE 384000 // 1 second of 96khz 32bit audio
> In order to at least have enough space in buffer to decode all samples
> from one frame. Is this the best way to do (I really doubt so) or what
> else can be done ?

IIRC there's no practical limit to the size of one frame.  Those
gorilla size frames need to be handled some other way.

> By the way, FFMpeg only supports 16bits audio samples right ? So if
> anything else in found by demuxer (8/24 bits, I can just drop the
> file, right ?)

No.  The demuxer should report and return whatever it finds.  The
decoder may then give an error if the stream is not supported.

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list