]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
output last frame if seq end code is encountered
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Thu, 2 Aug 2007 20:49:42 +0000 (20:49 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Thu, 2 Aug 2007 20:49:42 +0000 (20:49 +0000)
fixes video decoding of AC3TEST.vob
closes issue19

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

libavcodec/mpeg12.c

index a370d7d4582a186a65e8fc452f85409f01db411a..e62827a41663b4c746b2018f1fb9a591ee203584 100644 (file)
@@ -2160,6 +2160,10 @@ int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size)
                 pc->frame_start_found=1;
                 break;
             }
+            if(state == SEQ_END_CODE){
+                pc->state=-1;
+                return i+1;
+            }
         }
     }
 
@@ -2196,7 +2200,7 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
     MpegEncContext *s2 = &s->mpeg_enc_ctx;
     dprintf(avctx, "fill_buffer\n");
 
-    if (buf_size == 0) {
+    if (buf_size == 0 || (buf_size == 4 && AV_RB32(buf) == SEQ_END_CODE)) {
         /* special case for last picture */
         if (s2->low_delay==0 && s2->next_picture_ptr) {
             *picture= *(AVFrame*)s2->next_picture_ptr;