From 3553b815f66cb42f79706d6be5c11c0b13d9ac2e Mon Sep 17 00:00:00 2001 From: James Almer Date: Thu, 9 Apr 2015 03:56:58 -0300 Subject: [PATCH] avcodec/libdcadec: honor AVCodecContext bitexact flag Reviewed-by: Michael Niedermayer Signed-off-by: James Almer --- libavcodec/libdcadec.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavcodec/libdcadec.c b/libavcodec/libdcadec.c index 3ac4bcbe92..9ea61fa872 100644 --- a/libavcodec/libdcadec.c +++ b/libavcodec/libdcadec.c @@ -167,8 +167,13 @@ static av_cold int dcadec_close(AVCodecContext *avctx) static av_cold int dcadec_init(AVCodecContext *avctx) { DCADecContext *s = avctx->priv_data; + int flags = 0; - s->ctx = dcadec_context_create(0); + /* Affects only lossy DTS profiles. DTS-HD MA is always bitexact */ + if (avctx->flags & CODEC_FLAG_BITEXACT) + flags |= DCADEC_FLAG_CORE_BIT_EXACT; + + s->ctx = dcadec_context_create(flags); if (!s->ctx) return AVERROR(ENOMEM);