[FFmpeg-devel] [PATCH]Fix ffplay -s -pix_fmt

Stefano Sabatini stefano.sabatini-lala at poste.it
Sat Jul 30 12:58:39 CEST 2011


On date Saturday 2011-07-30 14:26:37 +0200, Carl-Eugen Hoyos encoded:
> Hi!
> 
> Attached patch fixes Ticket 347, I will apply if nobody objects.
> 
> Carl Eugen

> diff --git a/doc/ffplay.texi b/doc/ffplay.texi
> index 44fbad1..389bbfa 100644
> --- a/doc/ffplay.texi
> +++ b/doc/ffplay.texi
> @@ -38,8 +38,9 @@ Force displayed width.
>  @item -y @var{height}
>  Force displayed height.
>  @item -s @var{size}

> -This option has been removed. Use private format options for specifying the
> -input video size.
> +Set frame size (WxH or abbreviation), needed for videos which don't
> +contain a header with the frame size like raw YUV.
> +This option has been deprecated in favour of -video_size.

This is not strictly very true, indeed is possible to implement a
private option with a different name, but with the same semantics, so
I suggest:

Set frame size (WxH or abbreviation), needed for videos which don't
contain a header with the frame size like raw YUV.  This option has
been deprecated in favour of private options, see for example
the video_size option in the rawvideo format.

>  @item -an
>  Disable audio.
>  @item -vn
> @@ -89,8 +90,8 @@ Read @var{input_file}.
>  @section Advanced options
>  @table @option
>  @item -pix_fmt @var{format}
> -This option has been removed. Use private options for specifying the
> -input pixel format.
> +Set pixel format.
> +This option has been deprecated in favour of -pixel_format.

Ditto.

>  @item -stats
>  Show the stream duration, the codec parameters, the current position in
>  the stream and the audio/video synchronisation drift.
> diff --git a/ffplay.c b/ffplay.c
> index 6bdf4b6..c2c32d0 100644
> --- a/ffplay.c
> +++ b/ffplay.c
> @@ -2810,9 +2810,9 @@ static void event_loop(void)
>  

>  static int opt_frame_size(const char *opt, const char *arg)
>  {
> -    av_log(NULL, AV_LOG_ERROR,
> -           "Option '%s' has been removed, use private format options instead\n", opt);
> -    return AVERROR(EINVAL);
> +    av_log(NULL, AV_LOG_WARNING, "Option -s is deprecated, use -video_size.\n");

> +    opt_default("video_size", arg);
> +    return 0;

return opt_default();

or it will ignore errors issued by opt_default(), and will always
result in a success (yes this should be fixed in ffmpeg.c as well).

>  }
>  
>  static int opt_width(const char *opt, const char *arg)
> @@ -2839,9 +2839,9 @@ static int opt_format(const char *opt, const char *arg)
>  
>  static int opt_frame_pix_fmt(const char *opt, const char *arg)
>  {
> -    av_log(NULL, AV_LOG_ERROR,
> -           "Option '%s' has been removed, use private format options instead\n", opt);
> -    return AVERROR(EINVAL);
> +    av_log(NULL, AV_LOG_WARNING, "Option -pix_fmt is deprecated, use -pixel_format.\n");

> +    opt_default("pixel_format", arg);
> +    return 0;

same here
-- 
FFmpeg = Foolish & Frenzy Merciless Peaceful Encoding/decoding Governor


More information about the ffmpeg-devel mailing list