[Ffmpeg-cvslog] r7905 - in trunk/libavformat: asf.c asf.h

michael subversion
Sat Feb 10 04:36:13 CET 2007


Author: michael
Date: Sat Feb 10 04:36:12 2007
New Revision: 7905

Modified:
   trunk/libavformat/asf.c
   trunk/libavformat/asf.h

Log:
use dvr-ms timestamps


Modified: trunk/libavformat/asf.c
==============================================================================
--- trunk/libavformat/asf.c	(original)
+++ trunk/libavformat/asf.c	Sat Feb 10 04:36:12 2007
@@ -600,6 +600,7 @@
     ByteIOContext *pb = &s->pb;
     int rsize = 1;
     int num = get_byte(pb);
+    int64_t ts0, ts1;
 
     asf->packet_segments--;
     asf->packet_key_frame = num >> 7;
@@ -616,7 +617,20 @@
             return -1;
         }
         asf->packet_frag_timestamp = get_le32(pb); // timestamp
-        url_fskip(pb, asf->packet_replic_size - 8);
+        if(asf->packet_replic_size >= 8+38+4){
+//            for(i=0; i<asf->packet_replic_size-8; i++)
+//                av_log(s, AV_LOG_DEBUG, "%02X ",get_byte(pb));
+//            av_log(s, AV_LOG_DEBUG, "\n");
+            url_fskip(pb, 10);
+            ts0= get_le64(pb);
+            ts1= get_le64(pb);
+            url_fskip(pb, 12);
+            get_le32(pb);
+            url_fskip(pb, asf->packet_replic_size - 8 - 38 - 4);
+            if(ts0!= -1) asf->packet_frag_timestamp= ts0/10000;
+            else         asf->packet_frag_timestamp= AV_NOPTS_VALUE;
+        }else
+            url_fskip(pb, asf->packet_replic_size - 8);
         rsize += asf->packet_replic_size; // FIXME - check validity
     } else if (asf->packet_replic_size==1){
         // multipacket - frag_offset is begining timestamp

Modified: trunk/libavformat/asf.h
==============================================================================
--- trunk/libavformat/asf.h	(original)
+++ trunk/libavformat/asf.h	Sat Feb 10 04:36:12 2007
@@ -107,7 +107,7 @@
     int packet_padsize;
     unsigned int packet_frag_offset;
     unsigned int packet_frag_size;
-    int packet_frag_timestamp;
+    int64_t packet_frag_timestamp;
     int packet_multi_size;
     int packet_obj_size;
     int packet_time_delta;




More information about the ffmpeg-cvslog mailing list