aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-05-24 13:08:00 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-05-24 13:08:00 +0000
commitcde073b44865e9d5e3863e865af921a3bf1dac1f (patch)
treebb1f010e1e8b1c7323aff915205f7b5329067620 /libavformat
parent77405fc8664d295f030be106aaffb3e6c9b07225 (diff)
downloadffmpeg-cde073b44865e9d5e3863e865af921a3bf1dac1f.tar.gz
100l (AVStream.duration)
Originally committed as revision 3154 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/avidec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 27d3991b8c..fbc81f0135 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -209,7 +209,9 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
get_le32(pb); /* start */
nb_frames = get_le32(pb);
st->start_time = 0;
- st->duration = nb_frames;
+ st->duration = av_rescale(nb_frames,
+ st->codec.frame_rate_base * AV_TIME_BASE,
+ st->codec.frame_rate);
url_fskip(pb, size - 9 * 4);
break;
case MKTAG('a', 'u', 'd', 's'):
@@ -239,7 +241,8 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
ast->sample_size = get_le32(pb); /* sample ssize */
//av_log(NULL, AV_LOG_DEBUG, "%d %d %d %d\n", ast->scale, ast->rate, ast->sample_size, ast->start);
st->start_time = 0;
- st->duration = length;
+ if (ast->rate != 0)
+ st->duration = (int64_t)length * AV_TIME_BASE / ast->rate;
url_fskip(pb, size - 12 * 4);
}
break;