@@ -269,7 +269,22 @@ int ff_decklink_set_format(AVFormatContext *avctx,
269269 if (ctx->bmd_mode == bmdModeUnknown)
270270 return -1 ;
271271
272- #if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000
272+ #if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b050000
273+ if (direction == DIRECTION_IN ) {
274+ BMDDisplayMode actualMode = ctx->bmd_mode ;
275+ if (ctx->dli ->DoesSupportVideoMode (ctx->video_input , ctx->bmd_mode , (BMDPixelFormat) cctx->raw_format ,
276+ bmdNoVideoInputConversion, bmdSupportedVideoModeDefault,
277+ &actualMode, &support) != S_OK || !support || ctx->bmd_mode != actualMode)
278+ return -1 ;
279+ } else {
280+ BMDDisplayMode actualMode = ctx->bmd_mode ;
281+ if (ctx->dlo ->DoesSupportVideoMode (bmdVideoConnectionUnspecified, ctx->bmd_mode , ctx->raw_format ,
282+ bmdNoVideoOutputConversion, bmdSupportedVideoModeDefault,
283+ &actualMode, &support) != S_OK || !support || ctx->bmd_mode != actualMode)
284+ return -1 ;
285+ }
286+ return 0 ;
287+ #elif BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000
273288 if (direction == DIRECTION_IN ) {
274289 if (ctx->dli ->DoesSupportVideoMode (ctx->video_input , ctx->bmd_mode , (BMDPixelFormat) cctx->raw_format ,
275290 bmdSupportedVideoModeDefault,
0 commit comments