aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Stebbins <stebbins@jetheaddev.com>2011-07-04 09:55:19 -0700
committerReinhard Tartler <siretart@tauware.de>2011-11-05 13:18:32 +0100
commit84fce203bdfa39bfaa55571ac6627aa2320e646d (patch)
tree09b4c39013692b9fd831b5ac560457e2c77c1165
parent572e94bc513353e31a58e40cbb043f6b0a58e415 (diff)
downloadffmpeg-84fce203bdfa39bfaa55571ac6627aa2320e646d.tar.gz
dca: set AVCodecContext frame_size for DTS audio
Set the frame size when decoding DTS audio. This has the side effect of fixing the computation of timestamps for DTS-HD in compute_pkt_fields. Since frame_size is not currently set, the duration of a frame is being guessed based on the streams bitrate. But for DTS-HD, the bitrate currently used is the rate of the DTS core which is much different than the whole DTS-HD stream and leads to a wildly inaccurate frame duration estimate. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com> (cherry picked from commit 49c7006c7e815d4330247624a9e6ba30e288cd02) Signed-off-by: Anton Khirnov <anton@khirnov.net> (cherry picked from commit 06318968853ff8c628bbc75fb126483c08f22fd9) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r--libavcodec/dca.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/dca.c b/libavcodec/dca.c
index 10bc956e98..493971384f 100644
--- a/libavcodec/dca.c
+++ b/libavcodec/dca.c
@@ -1224,6 +1224,7 @@ static int dca_decode_frame(AVCodecContext * avctx,
//set AVCodec values with parsed data
avctx->sample_rate = s->sample_rate;
avctx->bit_rate = s->bit_rate;
+ avctx->frame_size = s->sample_blocks * 32;
channels = s->prim_channels + !!s->lfe;