diff mbox series

[FFmpeg-devel,08/10] avformat/amr: Don't reimplement ff_raw_write_packet()

Message ID 20200407214603.19798-7-andreas.rheinhardt@gmail.com
State Accepted
Commit b5985ce44dea053d9de80b51d049dbb35e46e356
Headers show
Series [FFmpeg-devel] avformat/Makefile: Add missing rawenc dependency for iLBC muxer | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Andreas Rheinhardt April 7, 2020, 9:46 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/Makefile | 2 +-
 libavformat/amr.c    | 9 ++-------
 2 files changed, 3 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 09d5c7df4b..850f250b80 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -87,7 +87,7 @@  OBJS-$(CONFIG_AIFF_MUXER)                += aiffenc.o id3v2enc.o
 OBJS-$(CONFIG_AIX_DEMUXER)               += aixdec.o
 OBJS-$(CONFIG_ALP_DEMUXER)               += alp.o
 OBJS-$(CONFIG_AMR_DEMUXER)               += amr.o
-OBJS-$(CONFIG_AMR_MUXER)                 += amr.o
+OBJS-$(CONFIG_AMR_MUXER)                 += amr.o rawenc.o
 OBJS-$(CONFIG_AMRNB_DEMUXER)             += amr.o
 OBJS-$(CONFIG_AMRWB_DEMUXER)             += amr.o
 OBJS-$(CONFIG_ANM_DEMUXER)               += anm.o
diff --git a/libavformat/amr.c b/libavformat/amr.c
index b8a5debb16..e4f8e4d860 100644
--- a/libavformat/amr.c
+++ b/libavformat/amr.c
@@ -29,6 +29,7 @@  Only mono files are supported.
 #include "libavutil/channel_layout.h"
 #include "avformat.h"
 #include "internal.h"
+#include "rawenc.h"
 
 typedef struct {
     uint64_t cumulated_size;
@@ -62,12 +63,6 @@  static int amr_write_header(AVFormatContext *s)
     }
     return 0;
 }
-
-static int amr_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    avio_write(s->pb, pkt->data, pkt->size);
-    return 0;
-}
 #endif /* CONFIG_AMR_MUXER */
 
 static int amr_probe(const AVProbeData *p)
@@ -296,7 +291,7 @@  AVOutputFormat ff_amr_muxer = {
     .audio_codec       = AV_CODEC_ID_AMR_NB,
     .video_codec       = AV_CODEC_ID_NONE,
     .write_header      = amr_write_header,
-    .write_packet      = amr_write_packet,
+    .write_packet      = ff_raw_write_packet,
     .flags             = AVFMT_NOTIMESTAMPS,
 };
 #endif