summaryrefslogtreecommitdiff
path: root/libavdevice/decklink_dec.cpp
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2020-11-19 12:16:47 +0800
committerLimin Wang <lance.lmwang@gmail.com>2020-11-21 09:14:52 +0800
commit09f1d15ae8bd1d7f597aec9ced4f8ebe8762a4bd (patch)
tree1f43f2a2424e34650c8fd8cca1651ae391382116 /libavdevice/decklink_dec.cpp
parentc055a476b2498278861e938965852906407cc8e0 (diff)
downloadffmpeg-09f1d15ae8bd1d7f597aec9ced4f8ebe8762a4bd.tar.gz
avdevice/decklink_dec: map the raw_format instead of hardcode
The patch will change the numerical values for the string constants so bump micro version. Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavdevice/decklink_dec.cpp')
-rw-r--r--libavdevice/decklink_dec.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp
index 6517b9df13..049e1335b6 100644
--- a/libavdevice/decklink_dec.cpp
+++ b/libavdevice/decklink_dec.cpp
@@ -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 */