[FFmpeg-cvslog] dca: set AVCodecContext frame_size for DTS audio

John Stebbins git at videolan.org
Thu Sep 22 01:17:20 CEST 2011


ffmpeg | branch: release/0.8 | John Stebbins <stebbins at jetheaddev.com> | Mon Jul  4 09:55:19 2011 -0700| [0ab69793fc76b0653315b055fbfae4738a40d115] | committer: Anton Khirnov

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 at gmail.com>
(cherry picked from commit 49c7006c7e815d4330247624a9e6ba30e288cd02)

Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0ab69793fc76b0653315b055fbfae4738a40d115
---

 libavcodec/dca.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/libavcodec/dca.c b/libavcodec/dca.c
index a9b2c9b..fad6bce 100644
--- a/libavcodec/dca.c
+++ b/libavcodec/dca.c
@@ -1650,6 +1650,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;
 
     s->profile = FF_PROFILE_DTS;
 



More information about the ffmpeg-cvslog mailing list