On 10/10/14 at 00:45, Michael Niedermayer wrote:
> On Thu, Oct 09, 2014 at 11:22:07PM +0200, Simon Thelen wrote:
> > On 09/10/14 at 23:05, Michael Niedermayer wrote:
> > > On Wed, Oct 08, 2014 at 07:13:33PM +0200, Simon Thelen wrote:
> > > > Enabling -seek_error causes ffmpeg to quit when it notices that
> > > > stop_time <= start_time.
> > > is there a reason not to stop and continue ?
> > > iam asking as if not then this could be done unconditionally
> > I can't think of a reason as to why somebody would want to continue, but
> > I didn't want to mess with the default behavior so I thought a
> > conditional would be cleaner.
> > If you want, I can send another patch that makes exiting the default or
> > gets rid of the conditional entirely.
> 
> well, its mostly a question what the community prefers
> personally id just make it fail if what the user wants cant be
> done, if noone has any other oppinion
 
I've attached a patch that makes ffmpeg abort in this case. If nobody
else has any opinions on the issue, you can commit that one.

-- 
Simon Thelen
>From edc569b9ea5aa1d2f2484d105ce090cfccbb76d9 Mon Sep 17 00:00:00 2001
From: Simon Thelen <ffmpeg-...@c-14.de>
Date: Fri, 10 Oct 2014 23:04:01 +0200
Subject: [PATCH] ffmpeg_opt: abort if -to <= -ss

Makes ffmpeg abort instead of continuing when stop_time <= start_time.

Closes ticket #4015.

Signed-off-by: Simon Thelen <ffmpeg-...@c-14.de>
---
 ffmpeg_opt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 10aaa3a..c518ae1 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -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;
         }
-- 
2.1.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to