---
 libavformat/flvenc.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index ff6d14a..2cccc6d 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -208,6 +208,10 @@ 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 +219,10 @@ 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;
-- 
1.7.10.4
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to