changeset 3984:46fc6e792241 libavformat

Favor even chunk sizes in ambiguous cases. Fixes transcode_069_produces_uneven_chunk_size.avi.
author michael
date Sat, 04 Oct 2008 22:26:43 +0000
parents 38269a4cfe68
children acb0ad37d372
files avidec.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/avidec.c	Sat Oct 04 21:57:01 2008 +0000
+++ b/avidec.c	Sat Oct 04 22:26:43 2008 +0000
@@ -52,6 +52,7 @@
     int64_t  movi_end;
     int64_t  fsize;
     int64_t movi_list;
+    int64_t last_pkt_pos;
     int index_loaded;
     int is_odml;
     int non_interleaved;
@@ -701,6 +702,7 @@
 
         if(size > ast->remaining)
             size= ast->remaining;
+        avi->last_pkt_pos= url_ftell(pb);
         av_get_packet(pb, pkt, size);
 
         if(ast->has_pal && pkt->data && pkt->size<(unsigned)INT_MAX/2){
@@ -782,6 +784,9 @@
 
         n= get_stream_idx(d);
 
+        if(!((i-avi->last_pkt_pos)&1) && get_stream_idx(d+1) < s->nb_streams)
+            continue;
+
         //parse ##dc/##wb
         if(n < s->nb_streams){
             AVStream *st;