From cb595b7f029297750e9fd98d0a4d12f2e2c38ea4 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 13 Jan 2009 19:32:08 +0000 Subject: [PATCH] Add dummy mp1_decoder to complement the existing dummy mp2/mp3 decoders. Originally committed as revision 16581 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/Makefile | 1 + libavcodec/allcodecs.c | 1 + libavcodec/mpegaudio_parser.c | 2 +- libavcodec/mpegaudiodec.c | 16 ++++++++++++++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index f2f544c..e026ffa 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -124,6 +124,7 @@ OBJS-$(CONFIG_MJPEGB_DECODER) += mjpegbdec.o mjpegdec.o mjpeg.o OBJS-$(CONFIG_MLP_DECODER) += mlpdec.o mlp_parser.o mlp.o OBJS-$(CONFIG_MMVIDEO_DECODER) += mmvideo.o OBJS-$(CONFIG_MOTIONPIXELS_DECODER) += motionpixels.o +OBJS-$(CONFIG_MP1_DECODER) += mpegaudiodec.o mpegaudiodecheader.o mpegaudio.o mpegaudiodata.o OBJS-$(CONFIG_MP2_DECODER) += mpegaudiodec.o mpegaudiodecheader.o mpegaudio.o mpegaudiodata.o OBJS-$(CONFIG_MP2_ENCODER) += mpegaudioenc.o mpegaudio.o mpegaudiodata.o OBJS-$(CONFIG_MP3_DECODER) += mpegaudiodec.o mpegaudiodecheader.o mpegaudio.o mpegaudiodata.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index d1bfff9..62f1b8b 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -189,6 +189,7 @@ void avcodec_register_all(void) REGISTER_DECODER (MACE3, mace3); REGISTER_DECODER (MACE6, mace6); REGISTER_DECODER (MLP, mlp); + REGISTER_DECODER (MP1, mp1); REGISTER_ENCDEC (MP2, mp2); REGISTER_DECODER (MP3, mp3); REGISTER_DECODER (MP3ADU, mp3adu); diff --git a/libavcodec/mpegaudio_parser.c b/libavcodec/mpegaudio_parser.c index e4b17b0..5573cac 100644 --- a/libavcodec/mpegaudio_parser.c +++ b/libavcodec/mpegaudio_parser.c @@ -248,7 +248,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1, AVCodecParser mpegaudio_parser = { - { CODEC_ID_MP2, CODEC_ID_MP3 }, + { CODEC_ID_MP1, CODEC_ID_MP2, CODEC_ID_MP3 }, sizeof(MpegAudioParseContext), mpegaudio_parse_init, mpegaudio_parse, diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index a853562..a1386a0 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -2534,6 +2534,22 @@ static int decode_frame_mp3on4(AVCodecContext * avctx, } #endif /* CONFIG_MP3ON4_DECODER */ +#ifdef CONFIG_MP1_DECODER +AVCodec mp1_decoder = +{ + "mp1", + CODEC_TYPE_AUDIO, + CODEC_ID_MP1, + sizeof(MPADecodeContext), + decode_init, + NULL, + NULL, + decode_frame, + CODEC_CAP_PARSE_ONLY, + .flush= flush, + .long_name= NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"), +}; +#endif #ifdef CONFIG_MP2_DECODER AVCodec mp2_decoder = { -- 2.7.4