ffmpeg_opt: abort if -to <= -ss
authorSimon Thelen <ffmpeg-dev@c-14.de>
Fri, 10 Oct 2014 21:04:01 +0000 (23:04 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 11 Oct 2014 20:20:39 +0000 (22:20 +0200)
Makes ffmpeg abort instead of continuing when stop_time <= start_time.

Closes ticket #4015.

Signed-off-by: Simon Thelen <ffmpeg-dev@c-14.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffmpeg_opt.c

index 10aaa3a..c518ae1 100644 (file)
@@ -1732,8 +1732,8 @@ static int open_output_file(OptionsContext *o, const char *filename)
     if (o->stop_time != INT64_MAX && o->recording_time == INT64_MAX) {
         int64_t start_time = o->start_time == AV_NOPTS_VALUE ? 0 : o->start_time;
         if (o->stop_time <= start_time) {
-            av_log(NULL, AV_LOG_WARNING, "-to value smaller than -ss; ignoring -to.\n");
-            o->stop_time = INT64_MAX;
+            av_log(NULL, AV_LOG_ERROR, "-to value smaller than -ss; aborting.\n");
+            exit_program(1);
         } else {
             o->recording_time = o->stop_time - start_time;
         }