[FFmpeg-devel] [PATCH 1/2] ffmpeg: warn when -t is used for inputs.

Clément Bœsch ubitux at gmail.com
Thu Jun 28 21:28:04 CEST 2012


On Thu, Jun 28, 2012 at 09:09:14PM +0200, Nicolas George wrote:
> Using -t on an input already have surprising results.
> Furthermore, using it on an input or an output makes
> a real difference if there are speed-altering filters.
> 
> Implementing -t for inputs will probably result in some
> behavour changes.
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  ffmpeg.c |   10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/ffmpeg.c b/ffmpeg.c
> index f6ce70b..8878ecc 100644
> --- a/ffmpeg.c
> +++ b/ffmpeg.c
> @@ -531,8 +531,14 @@ static void reset_options(OptionsContext *o, int is_input)
>  
>      memset(o, 0, sizeof(*o));
>  
> -    if(is_input) o->recording_time = bak.recording_time;
> -    else         o->recording_time = INT64_MAX;
> +    if(is_input) {

nit: feel free to add a space where appropriate since you are changing the
line.

> +        o->recording_time = bak.recording_time;
> +        if (o->recording_time != INT64_MAX)
> +            av_log(NULL, AV_LOG_WARNING,
> +                   "-t is not an inupt option; keeping it for the next output;"

input*

nit+: I'd replace the first ';' with a ','

> +                   " consider fixing your command line.\n");
> +    } else 

trailing whitespace?

> +        o->recording_time = INT64_MAX;
>      o->mux_max_delay  = 0.7;
>      o->limit_filesize = UINT64_MAX;
>      o->chapters_input_file = INT_MAX;

Otherwise, LGTM.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120628/b7c588c9/attachment.asc>


More information about the ffmpeg-devel mailing list