]> git.sesse.net Git - ffmpeg/blobdiff - libavdevice/decklink_dec.cpp
avdevice/decklink_dec: map the raw_format instead of hardcode
[ffmpeg] / libavdevice / decklink_dec.cpp
index 6517b9df133a6bf79e43d982a05826d0d4e8a2a0..049e1335b63a1225cfce1af07997b805545fd377 100644 (file)
@@ -1152,7 +1152,8 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx)
     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 */