summaryrefslogtreecommitdiff
path: root/libavcodec/dnxhddec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-01-29 21:11:27 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-01-29 21:21:49 +0100
commit56252a5e097946be03ba67664d5efc20703a17a1 (patch)
tree0643e339b4208a2806dafa6601248afc01002144 /libavcodec/dnxhddec.c
parent64e7cf12532ecca43535db7a10303b99538a41dc (diff)
parent1a07df31128da3a0020b66502399989b91770d44 (diff)
Merge commit '1a07df31128da3a0020b66502399989b91770d44'
* commit '1a07df31128da3a0020b66502399989b91770d44': DNxHD: Add support for id 1258 (DNx100 960x720@8) Conflicts: Changelog libavcodec/dnxhddata.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dnxhddec.c')
-rw-r--r--libavcodec/dnxhddec.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index b9ee2ef16e..433597720f 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -175,6 +175,15 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
if ((ret = dnxhd_init_vlc(ctx, cid)) < 0)
return ret;
+ // make sure profile size constraints are respected
+ // DNx100 allows 1920->1440 and 1280->960 subsampling
+ if (ctx->width != ctx->cid_table->width) {
+ av_reduce(&ctx->avctx->sample_aspect_ratio.num,
+ &ctx->avctx->sample_aspect_ratio.den,
+ ctx->width, ctx->cid_table->width, 255);
+ ctx->width = ctx->cid_table->width;
+ }
+
if (buf_size < ctx->cid_table->coding_unit_size) {
av_log(ctx->avctx, AV_LOG_ERROR, "incorrect frame size (%d < %d).\n",
buf_size, ctx->cid_table->coding_unit_size);