summaryrefslogtreecommitdiff
path: root/libavcodec/dca_parser.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2016-02-03 12:43:44 +0100
committerHendrik Leppkes <h.leppkes@gmail.com>2016-02-04 12:16:19 +0100
commita969a914f5586b1110d77736bc8a57bfe315f96d (patch)
treed5de21a5ec62aecb61a54b82d586c1728ad7b297 /libavcodec/dca_parser.c
parentb3b0ecee1550eb3cba0f4c198948f674f675780c (diff)
dca_parser: ensure frame duration matches the actual sample rate
The parser only parses the core, and thus has a duration relative to the core sample rate only, not the actual stream sample rate. FATE references changed due to now correct timestamps.
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;