[FFmpeg-devel,1/4] lavf: add MP1 muxer

Submitted by Rodger Combs on Oct. 19, 2017, 7:39 a.m.

Details

Message ID 20171019073948.23683-1-rodger.combs@gmail.com
State New
Headers show

Commit Message

Rodger Combs Oct. 19, 2017, 7:39 a.m.
---
 libavformat/Makefile     |  1 +
 libavformat/allformats.c |  1 +
 libavformat/rawenc.c     | 13 +++++++++++++
 3 files changed, 15 insertions(+)

Comments

Michael Niedermayer Oct. 19, 2017, 8:44 p.m.
On Thu, Oct 19, 2017 at 02:39:45AM -0500, Rodger Combs wrote:
> ---
>  libavformat/Makefile     |  1 +
>  libavformat/allformats.c |  1 +
>  libavformat/rawenc.c     | 13 +++++++++++++
>  3 files changed, 15 insertions(+)

please add a fate test for this too

[...]

Patch hide | download patch | download mbox

diff --git a/libavformat/Makefile b/libavformat/Makefile
index d955a8b12a..2522a3e768 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -296,6 +296,7 @@  OBJS-$(CONFIG_MOV_DEMUXER)               += mov.o mov_chan.o replaygain.o
 OBJS-$(CONFIG_MOV_MUXER)                 += movenc.o avc.o hevc.o vpcc.o \
                                             movenchint.o mov_chan.o rtp.o \
                                             movenccenc.o rawutils.o
+OBJS-$(CONFIG_MP1_MUXER)                 += rawenc.o
 OBJS-$(CONFIG_MP2_MUXER)                 += rawenc.o
 OBJS-$(CONFIG_MP3_DEMUXER)               += mp3dec.o replaygain.o
 OBJS-$(CONFIG_MP3_MUXER)                 += mp3enc.o rawenc.o id3v2enc.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 405ddb5ad9..32e9a979bc 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -189,6 +189,7 @@  static void register_all(void)
     REGISTER_DEMUXER (MM,               mm);
     REGISTER_MUXDEMUX(MMF,              mmf);
     REGISTER_MUXDEMUX(MOV,              mov);
+    REGISTER_MUXER   (MP1,              mp1);
     REGISTER_MUXER   (MP2,              mp2);
     REGISTER_MUXDEMUX(MP3,              mp3);
     REGISTER_MUXER   (MP4,              mp4);
diff --git a/libavformat/rawenc.c b/libavformat/rawenc.c
index f640121cb4..1a30ba6c05 100644
--- a/libavformat/rawenc.c
+++ b/libavformat/rawenc.c
@@ -361,6 +361,19 @@  AVOutputFormat ff_mlp_muxer = {
 };
 #endif
 
+#if CONFIG_MP1_MUXER
+AVOutputFormat ff_mp1_muxer = {
+    .name              = "mp1",
+    .long_name         = NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"),
+    .mime_type         = "audio/mpeg",
+    .extensions        = "mp1,m1a",
+    .audio_codec       = AV_CODEC_ID_MP1,
+    .video_codec       = AV_CODEC_ID_NONE,
+    .write_packet      = ff_raw_write_packet,
+    .flags             = AVFMT_NOTIMESTAMPS,
+};
+#endif
+
 #if CONFIG_MP2_MUXER
 AVOutputFormat ff_mp2_muxer = {
     .name              = "mp2",