diff options
author | Rafaël Carré <funman@videolan.org> | 2013-04-15 13:14:28 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-04-16 10:31:38 +0200 |
commit | 5b27c307e7532d6a76dceb555c3c039e81517bd1 (patch) | |
tree | 619db6f33510e70db24f9aeb0e0384ff749b5496 | |
parent | 6add6272dac78c95c4993f3789b86e9330baa718 (diff) | |
download | ffmpeg-5b27c307e7532d6a76dceb555c3c039e81517bd1.tar.gz |
flvenc: do not mux more than one stream per type
FLV does not support multiple audio or video streams.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r-- | libavformat/flvenc.c | 10 |
1 files changed, 10 insertions, 0 deletions
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; |