changeset 640:6f3a6774df82 libavformat

handle fixed sample_size patch by Roine Gustafsson <roine AT users.sourceforge.net>
author mmu_man
date Sat, 08 Jan 2005 16:07:34 +0000
parents 0b52743104ac
children 4f45848cc1ec
files mov.c
diffstat 1 files changed, 14 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/mov.c	Sat Jan 08 14:21:33 2005 +0000
+++ b/mov.c	Sat Jan 08 16:07:34 2005 +0000
@@ -1716,6 +1716,7 @@
     int64_t offset = 0x0FFFFFFFFFFFFFFFLL;
     int i, a, b, m;
     int size;
+    int idx;
     size = 0x0FFFFFFF;
 
 #ifdef MOV_SPLIT_CHUNKS
@@ -1727,7 +1728,7 @@
 	idx = sc->sample_to_chunk_index;
 
         if (idx < 0) return 0;
-	size = sc->sample_sizes[sc->current_sample];
+	size = (sc->sample_size)?sc->sample_size:sc->sample_sizes[sc->current_sample];
 
         sc->current_sample++;
         sc->left_in_chunk--;
@@ -1814,21 +1815,19 @@
 
 #ifdef MOV_SPLIT_CHUNKS
     /* split chunks into samples */
-    if (sc->sample_size == 0) {
-        int idx = sc->sample_to_chunk_index;
-        if ((idx + 1 < sc->sample_to_chunk_sz)
-	    && (sc->next_chunk >= sc->sample_to_chunk[idx + 1].first))
-           idx++;
-        sc->sample_to_chunk_index = idx;
-        if (idx >= 0 && sc->sample_to_chunk[idx].count != 1) {
-	    mov->partial = sc;
-            /* we'll have to get those samples before next chunk */
-            sc->left_in_chunk = sc->sample_to_chunk[idx].count - 1;
-            size = sc->sample_sizes[sc->current_sample];
-        }
+    idx = sc->sample_to_chunk_index;
+    if ((idx + 1 < sc->sample_to_chunk_sz)
+            && (sc->next_chunk >= sc->sample_to_chunk[idx + 1].first))
+        idx++;
+    sc->sample_to_chunk_index = idx;
+    if (idx >= 0 && sc->sample_to_chunk[idx].count != 1) {
+        mov->partial = sc;
+        /* we'll have to get those samples before next chunk */
+        sc->left_in_chunk = sc->sample_to_chunk[idx].count - 1;
+        size = (sc->sample_size)?sc->sample_size:sc->sample_sizes[sc->current_sample];
+    }
 
-        sc->current_sample++;
-    }
+    sc->current_sample++;
 #endif
 
 readchunk: