X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fdca_parser.c;h=bde7dfe885f57ee4e18a97d4d30ed28e1f741800;hb=b098e1a4697573d5c501aceb863d89ebf1fcd5fd;hp=70e64a89b8d6826ef7355c1744368b4f97133fc7;hpb=4736f8115be411bb0cf24a4386d98c53553f919c;p=ffmpeg diff --git a/libavcodec/dca_parser.c b/libavcodec/dca_parser.c index 70e64a89b8d..bde7dfe885f 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;