[FFmpeg-devel] [PATCH] lavc/xv: report if no adaptor present.

Stefano Sabatini stefasab at gmail.com
Sun Dec 29 12:49:41 CET 2013


On date Sunday 2013-12-29 11:31:25 +0100, Nicolas George encoded:
> Signed-off-by: Nicolas George <george at nsup.org>
> ---
>  libavdevice/xv.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/libavdevice/xv.c b/libavdevice/xv.c
> index ad60482..a4b44c8 100644
> --- a/libavdevice/xv.c
> +++ b/libavdevice/xv.c
> @@ -149,6 +149,10 @@ static int xv_write_header(AVFormatContext *s)
>          ret = AVERROR_EXTERNAL;
>          goto fail;
>      }
> +    if (!num_adaptors) {
> +        av_log(s, AV_LOG_ERROR, "No X-Video adaptors present\n");
> +        return AVERROR(ENODEV);
> +    }

LGTM, thanks.

>      xv->xv_port = ai[0].base_id;

I wonder if we should allow to list/set the present adaptors.
-- 
FFmpeg = Frenzy & Fascinating Martial Pacific Erroneous Gadget


More information about the ffmpeg-devel mailing list