[FFmpeg-devel] [PATCH 1/6] Return meaningful error codes, rather than always -1.

Luca Abeni lucabe72
Sun Apr 25 10:49:50 CEST 2010


Hi,


On Sat, 2010-04-24 at 20:53 +0200, Stefano Sabatini wrote:
> ---
>  libavdevice/v4l2.c |   34 +++++++++++++++++-----------------
>  1 files changed, 17 insertions(+), 17 deletions(-)
> 
> diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
[...]

the "return -1 ---> return AVERROR(errno)" changes look ok, but I am not
sure if the following change is correct:
> +        return AVERROR(errno);
>      }
>      if ((cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) == 0) {
>          av_log(ctx, AV_LOG_ERROR, "Not a video capture device\n");
>          close(fd);
>  
> -        return -1;
> +        return AVERROR(ENOSYS);


BTW, I was going to miss this patch: you should use a more descriptive
subject (example: return meaningful error codes in v4l2.c).


				Luca




More information about the ffmpeg-devel mailing list