summaryrefslogtreecommitdiff
path: root/libavformat/rmdec.c
diff options
context:
space:
mode:
authorWilliam Yu <genwillyu@gmail.com>2012-07-13 17:16:01 +0800
committerMichael Niedermayer <michaelni@gmx.at>2012-07-17 16:47:20 +0200
commit6d4e0d1b7e5ef6b24be477df2e02e5f4766a7e54 (patch)
treee78c25fc53a31da5c96e0632d6cb733390904936 /libavformat/rmdec.c
parent21d82554236b7f566da93e83f87676129b530ffd (diff)
avf:rmdec.c fill duration to AVFormatContext
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rmdec.c')
-rw-r--r--libavformat/rmdec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index d919a9a41a..76b3bdfb62 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -475,7 +475,8 @@ static int rm_read_header(AVFormatContext *s)
avio_rb32(pb); /* max packet size */
avio_rb32(pb); /* avg packet size */
avio_rb32(pb); /* nb packets */
- avio_rb32(pb); /* duration */
+ duration = avio_rb32(pb); /* duration */
+ s->duration = av_rescale(duration, AV_TIME_BASE, 1000);
avio_rb32(pb); /* preroll */
indx_off = avio_rb32(pb); /* index offset */
data_off = avio_rb32(pb); /* data offset */
@@ -499,6 +500,8 @@ static int rm_read_header(AVFormatContext *s)
duration = avio_rb32(pb); /* duration */
st->start_time = start_time;
st->duration = duration;
+ if(duration>0)
+ s->duration = AV_NOPTS_VALUE;
get_str8(pb, buf, sizeof(buf)); /* desc */
get_str8(pb, buf, sizeof(buf)); /* mimetype */
st->codec->codec_type = AVMEDIA_TYPE_DATA;