aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanjo <pulento@users.sourceforge.net>2002-03-10 14:51:20 +0000
committerJuanjo <pulento@users.sourceforge.net>2002-03-10 14:51:20 +0000
commit5798368bafa1fc2fefa6817d02c4d41622ba08fd (patch)
tree91f2fcea829907e1d037e787ee06046ff1e3f2bb
parenta674139801e6bc7d8d905cd700f55592a4f5050a (diff)
downloadffmpeg-5798368bafa1fc2fefa6817d02c4d41622ba08fd.tar.gz
- Added MP3 encoding through libmp3lame contributed by Lennert Buytenhek.
- Changes on AVI and WAV muxers to support MP3. Originally committed as revision 324 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libav/avienc.c6
-rw-r--r--libav/wav.c7
-rw-r--r--libavcodec/Makefile4
3 files changed, 13 insertions, 4 deletions
diff --git a/libav/avienc.c b/libav/avienc.c
index b894fd7280..1be5da424c 100644
--- a/libav/avienc.c
+++ b/libav/avienc.c
@@ -127,6 +127,10 @@ void parse_specific_params(AVCodecContext *stream, int *au_byterate, int *au_ssi
*au_ssize = 1;
*au_scale = 1;
*au_byterate = stream->bit_rate / 8;
+ case CODEC_ID_MP3LAME:
+ *au_ssize = 1;
+ *au_scale = 1;
+ *au_byterate = stream->bit_rate / 8;
default:
*au_ssize = 1;
*au_scale = 1;
@@ -361,7 +365,7 @@ static int avi_write_trailer(AVFormatContext *s)
if (nb_frames < stream->frame_number)
nb_frames = stream->frame_number;
} else {
- if (stream->codec_id == CODEC_ID_MP2) {
+ if (stream->codec_id == CODEC_ID_MP2 || stream->codec_id == CODEC_ID_MP3LAME) {
put_le32(pb, stream->frame_number);
nb_frames += stream->frame_number;
} else {
diff --git a/libav/wav.c b/libav/wav.c
index f909ddf738..df18a64ec7 100644
--- a/libav/wav.c
+++ b/libav/wav.c
@@ -21,6 +21,7 @@
CodecTag codec_wav_tags[] = {
{ CODEC_ID_MP2, 0x55 },
+ { CODEC_ID_MP3LAME, 0x55 },
{ CODEC_ID_MP2, 0x50 },
{ CODEC_ID_AC3, 0x2000 },
{ CODEC_ID_PCM_S16LE, 0x01 },
@@ -45,13 +46,13 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
enc->codec_id == CODEC_ID_PCM_ALAW ||
enc->codec_id == CODEC_ID_PCM_MULAW) {
bps = 8;
- } else if (enc->codec_id == CODEC_ID_MP2) {
+ } else if (enc->codec_id == CODEC_ID_MP2 || enc->codec_id == CODEC_ID_MP3LAME) {
bps = 0;
} else {
bps = 16;
}
- if (enc->codec_id == CODEC_ID_MP2)
+ if (enc->codec_id == CODEC_ID_MP2 || enc->codec_id == CODEC_ID_MP3LAME)
blkalign = 1;
else
blkalign = enc->channels*bps >> 3;
@@ -64,7 +65,7 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
put_le32(pb, bytespersec); /* bytes per second */
put_le16(pb, blkalign); /* block align */
put_le16(pb, bps); /* bits per sample */
- if (enc->codec_id == CODEC_ID_MP2) {
+ if (enc->codec_id == CODEC_ID_MP2 || enc->codec_id == CODEC_ID_MP3LAME) {
put_le16(pb, 12); /* wav_extra_size */
put_le16(pb, 1); /* wID */
put_le32(pb, 2); /* fdwFlags */
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index fe124a4a1c..00d10b76bb 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -16,6 +16,10 @@ OBJS+= ac3dec.o \
libac3/imdct.o libac3/parse.o
endif
+ifeq ($(CONFIG_MP3LAME),yes)
+OBJS += mp3lameaudio.o
+endif
+
ifeq ($(TARGET_GPROF),yes)
CFLAGS+=-p
LDFLAGS+=-p