From 5b27c307e7532d6a76dceb555c3c039e81517bd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C3=ABl=20Carr=C3=A9?= Date: Mon, 15 Apr 2013 13:14:28 +0200 Subject: [PATCH 1/2] flvenc: do not mux more than one stream per type FLV does not support multiple audio or video streams. Signed-off-by: Luca Barbato --- libavformat/flvenc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index ff6d14a248..37f37773a0 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -208,6 +208,11 @@ static int flv_write_header(AVFormatContext *s) } else { framerate = 1 / av_q2d(s->streams[i]->codec->time_base); } + if (video_enc) { + av_log(s, AV_LOG_ERROR, + "at most one video stream is supported in flv\n"); + return AVERROR(EINVAL); + } video_enc = enc; if (enc->codec_tag == 0) { av_log(s, AV_LOG_ERROR, "video codec not compatible with flv\n"); @@ -215,6 +220,11 @@ static int flv_write_header(AVFormatContext *s) } break; case AVMEDIA_TYPE_AUDIO: + if (audio_enc) { + av_log(s, AV_LOG_ERROR, + "at most one audio stream is supported in flv\n"); + return AVERROR(EINVAL); + } audio_enc = enc; if (get_audio_flags(s, enc) < 0) return AVERROR_INVALIDDATA; From 7f1fd9763668c5863e743d108f501a00d1806da0 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 16 Apr 2013 16:09:16 +0200 Subject: [PATCH 2/2] cmdutils: Fix build with lavfi disabled Signed-off-by: Diego Biurrun --- cmdutils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmdutils.c b/cmdutils.c index feee51ce51..62f38cc83e 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -1268,6 +1268,7 @@ static void show_help_muxer(const char *name) show_help_children(fmt->priv_class, AV_OPT_FLAG_ENCODING_PARAM); } +#if CONFIG_AVFILTER static void show_help_filter(const char *name) { const AVFilter *f = avfilter_get_by_name(name); @@ -1305,6 +1306,7 @@ static void show_help_filter(const char *name) show_help_children(f->priv_class, AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM); } +#endif int show_help(void *optctx, const char *opt, const char *arg) { @@ -1326,8 +1328,10 @@ int show_help(void *optctx, const char *opt, const char *arg) show_help_demuxer(par); } else if (!strcmp(topic, "muxer")) { show_help_muxer(par); +#if CONFIG_AVFILTER } else if (!strcmp(topic, "filter")) { show_help_filter(par); +#endif } else { show_help_default(topic, par); }