[FFmpeg-cvslog] avformat/wavenc: w64 muxer supports only 1 stream

Paul B Mahol git at videolan.org
Fri Nov 25 11:19:22 EET 2022


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Nov 25 10:13:52 2022 +0100| [2ad199ae3131e9410e5c0c6a0e143dbd22973d02] | committer: Paul B Mahol

avformat/wavenc: w64 muxer supports only 1 stream

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2ad199ae3131e9410e5c0c6a0e143dbd22973d02
---

 libavformat/wavenc.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libavformat/wavenc.c b/libavformat/wavenc.c
index b08f862cf9..3531a8f909 100644
--- a/libavformat/wavenc.c
+++ b/libavformat/wavenc.c
@@ -527,6 +527,16 @@ const AVOutputFormat ff_wav_muxer = {
 #if CONFIG_W64_MUXER
 #include "w64.h"
 
+static av_cold int w64_init(AVFormatContext *ctx)
+{
+    if (ctx->nb_streams != 1) {
+        av_log(ctx, AV_LOG_ERROR, "This muxer only supports a single stream.\n");
+        return AVERROR(EINVAL);
+    }
+
+    return 0;
+}
+
 static void start_guid(AVIOContext *pb, const uint8_t *guid, int64_t *pos)
 {
     *pos = avio_tell(pb);
@@ -612,6 +622,7 @@ const AVOutputFormat ff_w64_muxer = {
     .priv_data_size    = sizeof(WAVMuxContext),
     .audio_codec       = AV_CODEC_ID_PCM_S16LE,
     .video_codec       = AV_CODEC_ID_NONE,
+    .init              = w64_init,
     .write_header      = w64_write_header,
     .write_packet      = wav_write_packet,
     .write_trailer     = w64_write_trailer,



More information about the ffmpeg-cvslog mailing list