]> git.sesse.net Git - ffmpeg/commitdiff
avformat/segafilmenc: Postpone check for existence of video stream
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 14 Jan 2020 03:13:31 +0000 (04:13 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 14 Jan 2020 22:00:35 +0000 (23:00 +0100)
Up until now, the Sega FILM muxer complained if the first stream wasn't a
video stream that there is no video stream at all which is of course
nonsense. So postpone this check.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/segafilmenc.c

index d721ec38fa90d02c16f171f903ed0225851e4aa1..56fc59a8112c3175ff7591475119ccb4e61d6086 100644 (file)
@@ -183,11 +183,11 @@ static int film_init(AVFormatContext *format_context)
             }
             film->video_index = i;
         }
+    }
 
-        if (film->video_index == -1) {
-            av_log(format_context, AV_LOG_ERROR, "No video stream present.\n");
-            return AVERROR(EINVAL);
-        }
+    if (film->video_index == -1) {
+        av_log(format_context, AV_LOG_ERROR, "No video stream present.\n");
+        return AVERROR(EINVAL);
     }
 
     if (audio != NULL && get_audio_codec_id(audio->codecpar->codec_id) < 0) {