[FFmpeg-devel] [PATCH 2/6] Implement IOCTL_ERROR macro and use it.

Luca Abeni lucabe72
Sun Apr 25 10:52:41 CEST 2010


Hi,

On Sat, 2010-04-24 at 20:53 +0200, Stefano Sabatini wrote:
[...] 
> +#define IOCTL_ERROR(ctx__, ioctl__) av_log(ctx__, AV_LOG_ERROR, "ioctl(" #ioctl__ "): %s\n", strerror(errno))
> +
>  static int device_open(AVFormatContext *ctx, uint32_t *capabilities)
>  {
>      struct v4l2_capability cap;
> @@ -177,8 +179,7 @@ static int device_open(AVFormatContext *ctx, uint32_t *capabilities)
>          return AVERROR(errno);
>      }
>      if (res < 0) {
> -        av_log(ctx, AV_LOG_ERROR, "ioctl(VIDIOC_QUERYCAP): %s\n",
> -                 strerror(errno));
> +        IOCTL_ERROR(ctx, VIDIOC_QUERYCAP);

I am not sure if this kind of changes really improve the readability.


			Luca




More information about the ffmpeg-devel mailing list