]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Fix 2 access units in a packet mp4s.
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 12 Apr 2009 20:43:52 +0000 (20:43 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 12 Apr 2009 20:43:52 +0000 (20:43 +0000)
Fixes issue944 and possibly others.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18474 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/h264.c

index 313ad2696f07782d4bdc6171f5b8711e759cb1c9..e0250a99d3567d35d2e4d494b581d0fc86ef6aa6 100644 (file)
@@ -3660,6 +3660,8 @@ static void field_end(H264Context *h){
         ff_er_frame_end(s);
 
     MPV_frame_end(s);
+
+    h->current_slice=0;
 }
 
 /**
@@ -3720,7 +3722,11 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
 
     first_mb_in_slice= get_ue_golomb(&s->gb);
 
-    if((s->flags2 & CODEC_FLAG2_CHUNKS) && first_mb_in_slice == 0){
+    if(first_mb_in_slice == 0){ //FIXME better field boundary detection
+        if(h0->current_slice && FIELD_PICTURE){
+            field_end(h);
+        }
+
         h0->current_slice = 0;
         if (!s0->first_field)
             s->current_picture_ptr= NULL;