[FFmpeg-devel] [PATCH]lavd/vfwcap: Pass pointers to int instead of long to av_parse_video_size().

Carl Eugen Hoyos ceffmpeg at gmail.com
Wed Apr 18 21:31:04 EEST 2018


2018-04-16 0:57 GMT+02:00, James Almer <jamrial at gmail.com>:
> On 4/15/2018 7:03 PM, Carl Eugen Hoyos wrote:
>> Hi!
>>
>> Attached patch is supposed to silence a user-reported warning, I
>> cannot currently test.
>>
>> libavdevice/vfwcap.c: In function 'vfw_read_header':
>> libavdevice/vfwcap.c:331:35: warning: passing argument 1 of
>> 'av_parse_video_size' from incompatible pointer type
>> [-Wincompatible-pointer-types]
>>          ret = av_parse_video_size(&bi->bmiHeader.biWidth,
>> &bi->bmiHeader.biHeight, ctx->video_size);
>>                                                   ^
>>
>> Please review, Carl Eugen
>>
>>
>> 0001-lavd-vfwcap-Pass-pointers-to-int-instead-of-long-to-.patch
>>
>>
>> From 5ef8c3562cc06786c492ba8bc04ff69f91cb3176 Mon Sep 17 00:00:00 2001
>> From: Carl Eugen Hoyos <ceffmpeg at gmail.com>
>> Date: Sun, 15 Apr 2018 23:40:19 +0200
>> Subject: [PATCH] lavd/vfwcap: Pass pointers to int instead of long to
>>  av_parse_video_size().
>>
>> Fixes the following warnings:
>> libavdevice/vfwcap.c:331:35: warning: passing argument 1 of
>> 'av_parse_video_size' from incompatible pointer type
>> libavdevice/vfwcap.c:331:59: warning: passing argument 2 of
>> 'av_parse_video_size' from incompatible pointer type
>> ---
>>  libavdevice/vfwcap.c |    5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavdevice/vfwcap.c b/libavdevice/vfwcap.c
>> index 6a923d9..e2ab276 100644
>> --- a/libavdevice/vfwcap.c
>> +++ b/libavdevice/vfwcap.c
>> @@ -328,11 +328,14 @@ static int vfw_read_header(AVFormatContext *s)
>>      }
>>
>>      if (ctx->video_size) {
>> -        ret = av_parse_video_size(&bi->bmiHeader.biWidth,
>> &bi->bmiHeader.biHeight, ctx->video_size);
>> +        int w, h;
>> +        ret = av_parse_video_size(&w, &h, ctx->video_size);
>>          if (ret < 0) {
>>              av_log(s, AV_LOG_ERROR, "Couldn't parse video size.\n");
>>              goto fail;
>>          }
>> +        bi->bmiHeader.biWidth  = w;
>> +        bi->bmiHeader.biHeight = h;
>
> Can confirm it removes the warnings, so LGTM.

Patch applied.

Thank you, Carl Eugen


More information about the ffmpeg-devel mailing list