[FFmpeg-devel] [PATCH] Make parse_date return INT64_MIN in case of unparsable input

Benoit Fouet benoit.fouet
Tue Sep 18 16:07:35 CEST 2007


Hi,

Stefano Sabatini wrote:
> Index: ffmpeg.c
> ===================================================================
> --- ffmpeg.c	(revision 10526)
> +++ ffmpeg.c	(working copy)
> @@ -2494,21 +2494,39 @@
>  static void opt_recording_time(const char *arg)
>  {
>      recording_time = parse_date(arg, 1);
> +    if (recording_time == INT64_MIN) {
> +        fprintf(stderr, "Unparsable duration specification: %s\n", arg);
>   

s/Unparsable/Invalid/ ?

> +        exit(1);
> +    }
>  }
>  
>  static void opt_start_time(const char *arg)
>  {
>      start_time = parse_date(arg, 1);
> +    if (start_time == INT64_MIN) {
> +        fprintf(stderr, "Unparsable duration specification: %s\n", arg);
>   

ditto

> +        exit(1);
> +    }
>  }
>  
>  static void opt_rec_timestamp(const char *arg)
>  {
> -    rec_timestamp = parse_date(arg, 0) / 1000000;
> +    int64_t rec_timestamp_us;
> +    rec_timestamp_us = parse_date(arg, 0);
>   

you can merge declaration and affectation

> +    if (rec_timestamp_us == INT64_MIN) {
> +        fprintf(stderr, "Unparsable date specification: %s\n", arg);
>   

same as before (and there are more after)


-- 
Ben
Purple Labs S.A.
www.purplelabs.com




More information about the ffmpeg-devel mailing list