summaryrefslogtreecommitdiff
path: root/libavcodec/dca_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/dca_parser.c')
-rw-r--r--libavcodec/dca_parser.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/dca_parser.c b/libavcodec/dca_parser.c
index 70e64a89b8..bde7dfe885 100644
--- a/libavcodec/dca_parser.c
+++ b/libavcodec/dca_parser.c
@@ -165,7 +165,9 @@ static int dca_parse(AVCodecParserContext *s, AVCodecContext *avctx,
/* read the duration and sample rate from the frame header */
if (!dca_parse_params(buf, buf_size, &duration, &sample_rate, &pc1->framesize)) {
- s->duration = duration;
+ if (!avctx->sample_rate)
+ avctx->sample_rate = sample_rate;
+ s->duration = av_rescale(duration, avctx->sample_rate, sample_rate);
} else
s->duration = 0;