# HG changeset patch # User michael # Date 1186087782 0 # Node ID a0838fadd37afd60005f960d7a69986ec8ea432d # Parent a8ca6409c0b22b20ebe6845df5fa1d53157db96a output last frame if seq end code is encountered fixes video decoding of AC3TEST.vob closes issue19 diff -r a8ca6409c0b2 -r a0838fadd37a mpeg12.c --- a/mpeg12.c Thu Aug 02 07:42:06 2007 +0000 +++ b/mpeg12.c Thu Aug 02 20:49:42 2007 +0000 @@ -2160,6 +2160,10 @@ pc->frame_start_found=1; break; } + if(state == SEQ_END_CODE){ + pc->state=-1; + return i+1; + } } } @@ -2196,7 +2200,7 @@ 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;