Author: rolf
Date: 2008-02-04 12:25:30 -0500 (Mon, 04 Feb 2008)
New Revision: 94765

Modified:
   trunk/moon/src/asf/ChangeLog
   trunk/moon/src/asf/asf.cpp
Log:
* asf.cpp: Don't create an index if we have a media with 0 packets.

Modified: trunk/moon/src/asf/ChangeLog
===================================================================
--- trunk/moon/src/asf/ChangeLog        2008-02-04 17:22:05 UTC (rev 94764)
+++ trunk/moon/src/asf/ChangeLog        2008-02-04 17:25:30 UTC (rev 94765)
@@ -1,5 +1,9 @@
 2008-02-04  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
 
+       * asf.cpp: Don't create an index if we have a media with 0 packets.
+
+2008-02-04  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
+
        * asf.cpp, asf.h: Fix more signedness problems.
 
 2008-02-04  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 

Modified: trunk/moon/src/asf/asf.cpp
===================================================================
--- trunk/moon/src/asf/asf.cpp  2008-02-04 17:22:05 UTC (rev 94764)
+++ trunk/moon/src/asf/asf.cpp  2008-02-04 17:25:30 UTC (rev 94765)
@@ -792,6 +792,11 @@
                
                // Max size here is 0xFFFF packets * 16 bytes per index = 
1.048.560 bytes
                index_size = packet_count;
+               
+               // Don't create any indices if there are no packets. 
+               if (index_size == 0)
+                       return;
+               
                index = (ASFFrameReaderIndex*) g_malloc0 (index_size * sizeof 
(ASFFrameReaderIndex));
                
                //printf ("ASFFrameReader::AddFrameIndex (): Created index: 
stream_count: %i, packet_count: %lld, index_size: %i, item size: %i, gives 
index size: %i bytes\n", stream_count, packet_count, index_size, sizeof 
(ASFFrameReaderIndex), index_size * sizeof (ASFFrameReaderIndex));
@@ -805,7 +810,7 @@
                        index [i].start_pts = INVALID_START_PTS;
                }
        }
-       
+        
        // index_size can't be 0 here.
        uint32_t k = MAX (packet_index, index_size - 1);
        uint64_t current_start = index [k].start_pts;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to