[FFmpeg-devel] [PATCH] Use v4l2 input format automatically if filename starts with "/dev/video"

Benoit Fouet benoit.fouet at free.fr
Fri Oct 24 18:34:12 CEST 2014


Hi,

Le 24/10/2014 17:50, Andrey Utkin a écrit :
> ---
>  libavdevice/v4l2.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
> index cf7a92c..ebc50bb 100644
> --- a/libavdevice/v4l2.c
> +++ b/libavdevice/v4l2.c
> @@ -806,6 +806,13 @@ static int device_try_init(AVFormatContext *ctx,
>      return ret;
>  }
>  
> +static int v4l2_read_probe(AVProbeData *p)
> +{
> +    if (av_strstart(p->filename, "/dev/video", NULL))

Shouldn't this also test p->filename for non-NULLness?
LGTM otherwise.

-- 
Ben



More information about the ffmpeg-devel mailing list