1
From 06318968853ff8c628bbc75fb126483c08f22fd9 Mon Sep 17 00:00:00 2001
2
From: John Stebbins <stebbins@jetheaddev.com>
3
Date: Mon, 4 Jul 2011 09:55:19 -0700
4
Subject: [PATCH 08/70] dca: set AVCodecContext frame_size for DTS audio
6
Set the frame size when decoding DTS audio.
8
This has the side effect of fixing the computation of timestamps for DTS-HD in compute_pkt_fields. Since frame_size is
9
not currently set, the duration of a frame is being guessed based on the streams bitrate. But for DTS-HD, the bitrate
10
currently used is the rate of the DTS core which is much different than the whole DTS-HD stream and leads to a wildly
11
inaccurate frame duration estimate.
13
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
14
(cherry picked from commit 49c7006c7e815d4330247624a9e6ba30e288cd02)
16
Signed-off-by: Anton Khirnov <anton@khirnov.net>
18
libavcodec/dca.c | 1 +
19
1 files changed, 1 insertions(+), 0 deletions(-)
21
diff --git a/libavcodec/dca.c b/libavcodec/dca.c
22
index a9b2c9b..fad6bce 100644
23
--- a/libavcodec/dca.c
24
+++ b/libavcodec/dca.c
25
@@ -1650,6 +1650,7 @@ static int dca_decode_frame(AVCodecContext * avctx,
26
//set AVCodec values with parsed data
27
avctx->sample_rate = s->sample_rate;
28
avctx->bit_rate = s->bit_rate;
29
+ avctx->frame_size = s->sample_blocks * 32;
31
s->profile = FF_PROFILE_DTS;