summaryrefslogtreecommitdiff
path: root/libavcodec/dnxhddec.c
diff options
context:
space:
mode:
authorChristophe Gisquet <christophe.gisquet@gmail.com>2015-10-03 18:59:17 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-10-05 12:44:00 +0200
commit1f4ff53aea7c5090f31cd1323d95f7c407c9b2bb (patch)
treeb592d6bfe4bf300c943b7814b634d808000b4fd2 /libavcodec/dnxhddec.c
parent52256860d6e3eb003294659ae015cd1f1b3ffdfc (diff)
dnxhddec: Introduce DNXHD_VARIABLE
Currently not used, but will be used to indicate that a CIDEntry field is not set, because it is variable, and that checks should be adapted. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/dnxhddec.c')
-rw-r--r--libavcodec/dnxhddec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 713ce6adbc..f71977a09d 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -106,7 +106,8 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid)
av_log(ctx->avctx, AV_LOG_ERROR, "unsupported cid %d\n", cid);
return AVERROR(ENOSYS);
}
- if (ff_dnxhd_cid_table[index].bit_depth != ctx->bit_depth) {
+ if (ff_dnxhd_cid_table[index].bit_depth != ctx->bit_depth &&
+ ff_dnxhd_cid_table[index].bit_depth != DNXHD_VARIABLE) {
av_log(ctx->avctx, AV_LOG_ERROR, "bit depth mismatches %d %d\n", ff_dnxhd_cid_table[index].bit_depth, ctx->bit_depth);
return AVERROR_INVALIDDATA;
}
@@ -228,7 +229,8 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
// make sure profile size constraints are respected
// DNx100 allows 1920->1440 and 1280->960 subsampling
- if (ctx->width != ctx->cid_table->width) {
+ if (ctx->width != ctx->cid_table->width &&
+ ctx->cid_table->width != DNXHD_VARIABLE) {
av_reduce(&ctx->avctx->sample_aspect_ratio.num,
&ctx->avctx->sample_aspect_ratio.den,
ctx->width, ctx->cid_table->width, 255);