[FFmpeg-devel] [PATCH] avcodec/libdcadec: honor AVCodecContext bitexact flag

James Almer jamrial at gmail.com
Thu Apr 9 08:58:39 CEST 2015


Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavcodec/libdcadec.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libdcadec.c b/libavcodec/libdcadec.c
index 3ac4bcb..9ea61fa 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);
 
-- 
2.3.5



More information about the ffmpeg-devel mailing list