changeset 771:581bec6f0eb0 libavformat

update current_sample number for non split mode fix chunk split decission
author michael
date Sat, 21 May 2005 10:41:52 +0000
parents 34e05913d999
children d3cec742f7c0
files mov.c
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mov.c	Sat May 21 10:25:58 2005 +0000
+++ b/mov.c	Sat May 21 10:41:52 2005 +0000
@@ -1942,14 +1942,13 @@
     }
 #endif //MOV_MINOLTA_FIX
 
+    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;
 #ifdef MOV_SPLIT_CHUNKS
     /* split chunks into samples */
-    if (sc->sample_size == 0) {
-        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 (sc->sample_size == 0 || sc->sample_size > 100) {
         if (idx >= 0 && sc->sample_to_chunk[idx].count != 1) {
 	    mov->partial = sc;
             /* we'll have to get those samples before next chunk */
@@ -1958,6 +1957,8 @@
         }
 
         sc->current_sample++;
+    }else if(idx + 1 < sc->sample_to_chunk_sz){
+        sc->current_sample += sc->sample_size * sc->sample_to_chunk[idx].count;
     }
 #endif