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

michael subversion
Wed Aug 23 22:24:59 CEST 2006


Author: michael
Date: Wed Aug 23 22:24:58 2006
New Revision: 6055

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

Log:
fix fallback if theres no index
fix index less seeking


Modified: trunk/libavformat/asf.c
==============================================================================
--- trunk/libavformat/asf.c	(original)
+++ trunk/libavformat/asf.c	Wed Aug 23 22:24:58 2006
@@ -823,7 +823,7 @@
             assert((asf_st->packet_pos - s->data_offset) % asf->packet_size == 0);
             pos= asf_st->packet_pos;
 
-            av_add_index_entry(s->streams[i], pos, pkt->size, pts, pos - start_pos[i] + 1, AVINDEX_KEYFRAME);
+            av_add_index_entry(s->streams[i], pos, pts, pkt->size, pos - start_pos[i] + 1, AVINDEX_KEYFRAME);
             start_pos[i]= asf_st->packet_pos + 1;
 
             if(pkt->stream_index == stream_index)
@@ -868,6 +868,7 @@
 
             av_add_index_entry(s->streams[stream_index], pos, index_pts, asf->packet_size, 0, AVINDEX_KEYFRAME);
         }
+        asf->index_read= 1;
     }
     url_fseek(&s->pb, current_pos, SEEK_SET);
 }
@@ -882,10 +883,10 @@
     if (asf->packet_size <= 0)
         return -1;
 
-    if (!st->index_entries)
+    if (!asf->index_read)
         asf_build_simple_index(s, stream_index);
 
-    if(!st->index_entries){
+    if(!(asf->index_read && st->index_entries)){
         if(av_seek_frame_binary(s, stream_index, pts, flags)<0)
             return -1;
     }else{

Modified: trunk/libavformat/asf.h
==============================================================================
--- trunk/libavformat/asf.h	(original)
+++ trunk/libavformat/asf.h	Wed Aug 23 22:24:58 2006
@@ -100,6 +100,7 @@
     uint64_t data_offset; /* begining of the first data packet */
     uint64_t data_object_offset; /* data object offset (excl. GUID & size)*/
     uint64_t data_object_size;   /* size of the data object */
+    int index_read;
 
     ASFMainHeader hdr;
 




More information about the ffmpeg-cvslog mailing list