[FFmpeg-devel] [PATCH 09/10] avformat/rso: Don't reimplement ff_raw_write_packet()

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Wed Apr 8 00:46:02 EEST 2020


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
 libavformat/Makefile | 2 +-
 libavformat/rsoenc.c | 9 ++-------
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 850f250b80..554b0bfbf8 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -444,7 +444,7 @@ OBJS-$(CONFIG_ROQ_MUXER)                 += idroqenc.o rawenc.o
 OBJS-$(CONFIG_RSD_DEMUXER)               += rsd.o
 OBJS-$(CONFIG_RPL_DEMUXER)               += rpl.o
 OBJS-$(CONFIG_RSO_DEMUXER)               += rsodec.o rso.o pcm.o
-OBJS-$(CONFIG_RSO_MUXER)                 += rsoenc.o rso.o
+OBJS-$(CONFIG_RSO_MUXER)                 += rsoenc.o rso.o rawenc.o
 OBJS-$(CONFIG_RTP_MPEGTS_MUXER)          += rtpenc_mpegts.o
 OBJS-$(CONFIG_RTP_MUXER)                 += rtp.o         \
                                             rtpenc_aac.o     \
diff --git a/libavformat/rsoenc.c b/libavformat/rsoenc.c
index 3159f0c427..beba94b2a7 100644
--- a/libavformat/rsoenc.c
+++ b/libavformat/rsoenc.c
@@ -22,6 +22,7 @@
 
 #include "avformat.h"
 #include "internal.h"
+#include "rawenc.h"
 #include "riff.h"
 #include "rso.h"
 
@@ -63,12 +64,6 @@ static int rso_write_header(AVFormatContext *s)
     return 0;
 }
 
-static int rso_write_packet(AVFormatContext *s, AVPacket *pkt)
-{
-    avio_write(s->pb, pkt->data, pkt->size);
-    return 0;
-}
-
 static int rso_write_trailer(AVFormatContext *s)
 {
     AVIOContext *pb = s->pb;
@@ -103,7 +98,7 @@ AVOutputFormat ff_rso_muxer = {
     .audio_codec    =   AV_CODEC_ID_PCM_U8,
     .video_codec    =   AV_CODEC_ID_NONE,
     .write_header   =   rso_write_header,
-    .write_packet   =   rso_write_packet,
+    .write_packet   =   ff_raw_write_packet,
     .write_trailer  =   rso_write_trailer,
     .codec_tag      =   (const AVCodecTag* const []){ff_codec_rso_tags, 0},
     .flags          =   AVFMT_NOTIMESTAMPS,
-- 
2.20.1



More information about the ffmpeg-devel mailing list