ctx->video_pts_source = cctx->video_pts_source;
ctx->draw_bars = cctx->draw_bars;
ctx->audio_depth = cctx->audio_depth;
- ctx->raw_format = (BMDPixelFormat)cctx->raw_format;
+ if (cctx->raw_format > 0 && (unsigned int)cctx->raw_format < FF_ARRAY_ELEMS(decklink_raw_format_map))
+ ctx->raw_format = decklink_raw_format_map[cctx->raw_format];
cctx->ctx = ctx;
/* Check audio channel option for valid values: 2, 8 or 16 */
}
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",