changeset 627:2cd604e839c7 libavformat

preroll is in ms pts should start at start_time
author michael
date Wed, 22 Dec 2004 03:04:21 +0000
parents 4a35651e6cc8
children 8909a59c9461
files asf.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/asf.c	Wed Dec 22 01:33:04 2004 +0000
+++ b/asf.c	Wed Dec 22 03:04:21 2004 +0000
@@ -196,9 +196,9 @@
             if (!asf_st)
                 goto fail;
             st->priv_data = asf_st;
-            st->start_time = asf->hdr.preroll / (10000000 / AV_TIME_BASE);
-	    st->duration = (asf->hdr.send_time - asf->hdr.preroll) / 
-                (10000000 / AV_TIME_BASE);
+            st->start_time = asf->hdr.preroll * (int64_t)AV_TIME_BASE / 1000;
+            st->duration = asf->hdr.send_time / 
+                (10000000 / AV_TIME_BASE) - st->start_time;
             get_guid(pb, &g);
             if (!memcmp(&g, &audio_stream, sizeof(GUID))) {
                 type = CODEC_TYPE_AUDIO;
@@ -599,7 +599,7 @@
 	    /* new packet */
 	    av_new_packet(&asf_st->pkt, asf->packet_obj_size);
 	    asf_st->seq = asf->packet_seq;
-	    asf_st->pkt.pts = asf->packet_frag_timestamp - asf->hdr.preroll;
+	    asf_st->pkt.pts = asf->packet_frag_timestamp;
 	    asf_st->pkt.stream_index = asf->stream_index;
             asf_st->packet_pos= asf->packet_pos;            
 //printf("new packet: stream:%d key:%d packet_key:%d audio:%d size:%d\n",