[FFmpeg-devel] [PATCH] Parse MDPR for audio/x-ralf-mpeg4

Ronald S. Bultje rsbultje
Thu Dec 24 16:51:20 CET 2009


Hi,

On Thu, Dec 24, 2009 at 10:01 AM, Jai Menon <jmenon86 at gmail.com> wrote:
> As in subject.

+            if (!st->codec->channels || st->codec->channels > 2) {
+                av_log(s, AV_LOG_ERROR, "Only mono and stereo RALF
streams are supported.\n");
+                return -1;
+            }
[..]
+            if (st->codec->bits_per_coded_sample != 16) {
+                av_log(s, AV_LOG_ERROR, "Invalid sample depth.\n");
+                return -1;
+            }
[..]
+            if (st->codec->sample_rate < 8000 ||
st->codec->sample_rate > 96000) {
+                av_log(s, AV_LOG_ERROR, "Invalid sampling rate.\n");
+                return -1;
+            }

These really do not belong in a demuxer. Maybe in libavformat/codec or
in the decoder, but not in rmdec.c.

+            get_be32(pb);  // Max. audio frame size (in bytes)

s->audio_framesize = ..

+            get_be32(pb);  // unused

Don't we just skip all unparsed data in the end, so at least that last
line is not necessary? Maybe you can store the max. audio frame size.

Ronald



More information about the ffmpeg-devel mailing list