summaryrefslogtreecommitdiff
path: root/libavformat/rm.c
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2003-08-08 17:52:53 +0000
committerFabrice Bellard <fabrice@bellard.org>2003-08-08 17:52:53 +0000
commit247eadca9d3158b91d500af27065d68aef7c9347 (patch)
treec951ea1a3a6a711d6227d6ae2aeee3174541bd26 /libavformat/rm.c
parentfa26a29d6508e71e52abc6d71ee37279b837de37 (diff)
update duration and start_time - add av_new_stream() usage
Originally committed as revision 2110 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rm.c')
-rw-r--r--libavformat/rm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/rm.c b/libavformat/rm.c
index 47b510b323..c4be2e37a3 100644
--- a/libavformat/rm.c
+++ b/libavformat/rm.c
@@ -473,7 +473,7 @@ static int rm_read_header(AVFormatContext *s, AVFormatParameters *ap)
unsigned int tag, v;
int tag_size, size, codec_data_size, i;
int64_t codec_pos;
- unsigned int h263_hack_version;
+ unsigned int h263_hack_version, start_time, duration;
char buf[128];
int flags = 0;
@@ -524,19 +524,19 @@ static int rm_read_header(AVFormatContext *s, AVFormatParameters *ap)
get_str(pb, s->comment, sizeof(s->comment));
break;
case MKTAG('M', 'D', 'P', 'R'):
- st = av_mallocz(sizeof(AVStream));
+ st = av_new_stream(s, 0);
if (!st)
goto fail;
- avcodec_get_context_defaults(&st->codec);
- s->streams[s->nb_streams++] = st;
st->id = get_be16(pb);
get_be32(pb); /* max bit rate */
st->codec.bit_rate = get_be32(pb); /* bit rate */
get_be32(pb); /* max packet size */
get_be32(pb); /* avg packet size */
- get_be32(pb); /* start time */
+ start_time = get_be32(pb); /* start time */
get_be32(pb); /* preroll */
- get_be32(pb); /* duration */
+ duration = get_be32(pb); /* duration */
+ st->start_time = start_time * (AV_TIME_BASE / 1000);
+ st->duration = duration * (AV_TIME_BASE / 1000);
get_str8(pb, buf, sizeof(buf)); /* desc */
get_str8(pb, buf, sizeof(buf)); /* mimetype */
codec_data_size = get_be32(pb);