diff mbox series

[FFmpeg-devel] avdevice/decklink_dec: fix build with older SDK

Message ID 20200914192442.16353-1-cus@passwd.hu
State Accepted
Commit 36c582f515a7da4c5dda4890fcf588164f91255f
Headers show
Series [FFmpeg-devel] avdevice/decklink_dec: fix build with older SDK | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Marton Balint Sept. 14, 2020, 7:24 p.m. UTC
Apparently bmdFormatUnspecified needs SDK 11.0. It is just a fancy way of
checking for zero, so let's do that instead.

Fixes build issue since f1b908d20a8.

Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavdevice/decklink_dec.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Gyan Doshi Sept. 15, 2020, 4:36 a.m. UTC | #1
On 15-09-2020 12:54 am, Marton Balint wrote:
> Apparently bmdFormatUnspecified needs SDK 11.0. It is just a fancy way of
> checking for zero, so let's do that instead.
>
> Fixes build issue since f1b908d20a8.
>
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
>   libavdevice/decklink_dec.cpp | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp
> index 92b8feed14..6517b9df13 100644
> --- a/libavdevice/decklink_dec.cpp
> +++ b/libavdevice/decklink_dec.cpp
> @@ -1232,7 +1232,7 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx)
>           }
>           av_log(avctx, AV_LOG_INFO, "Autodetected the input mode\n");
>       }
> -    if (ctx->raw_format == bmdFormatUnspecified)
> +    if (ctx->raw_format == (BMDPixelFormat)0)
>           ctx->raw_format = bmdFormat8BitYUV;
>       if (ff_decklink_set_format(avctx, DIRECTION_IN) < 0) {
>           av_log(avctx, AV_LOG_ERROR, "Could not set format code %s for %s\n",

LGTM.

Gyan
Marton Balint Sept. 15, 2020, 8:11 p.m. UTC | #2
On Tue, 15 Sep 2020, Gyan Doshi wrote:

>
>
> On 15-09-2020 12:54 am, Marton Balint wrote:
>> Apparently bmdFormatUnspecified needs SDK 11.0. It is just a fancy way of
>> checking for zero, so let's do that instead.
>>
>> Fixes build issue since f1b908d20a8.
>>
>> Signed-off-by: Marton Balint <cus@passwd.hu>
>> ---
>>   libavdevice/decklink_dec.cpp | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp
>> index 92b8feed14..6517b9df13 100644
>> --- a/libavdevice/decklink_dec.cpp
>> +++ b/libavdevice/decklink_dec.cpp
>> @@ -1232,7 +1232,7 @@ av_cold int ff_decklink_read_header(AVFormatContext 
> *avctx)
>>           }
>>           av_log(avctx, AV_LOG_INFO, "Autodetected the input mode\n");
>>       }
>> -    if (ctx->raw_format == bmdFormatUnspecified)
>> +    if (ctx->raw_format == (BMDPixelFormat)0)
>>           ctx->raw_format = bmdFormat8BitYUV;
>>       if (ff_decklink_set_format(avctx, DIRECTION_IN) < 0) {
>>           av_log(avctx, AV_LOG_ERROR, "Could not set format code %s for 
> %s\n",
>
> LGTM.

Thanks, applied.

Regards,
Marton
diff mbox series

Patch

diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp
index 92b8feed14..6517b9df13 100644
--- a/libavdevice/decklink_dec.cpp
+++ b/libavdevice/decklink_dec.cpp
@@ -1232,7 +1232,7 @@  av_cold int ff_decklink_read_header(AVFormatContext *avctx)
         }
         av_log(avctx, AV_LOG_INFO, "Autodetected the input mode\n");
     }
-    if (ctx->raw_format == bmdFormatUnspecified)
+    if (ctx->raw_format == (BMDPixelFormat)0)
         ctx->raw_format = bmdFormat8BitYUV;
     if (ff_decklink_set_format(avctx, DIRECTION_IN) < 0) {
         av_log(avctx, AV_LOG_ERROR, "Could not set format code %s for %s\n",