Commit 392b7482 authored by Michael Niedermayer's avatar Michael Niedermayer

output last frame if seq end code is encountered

fixes video decoding of AC3TEST.vob
closes issue19

Originally committed as revision 9870 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 61eade27
...@@ -2160,6 +2160,10 @@ int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size) ...@@ -2160,6 +2160,10 @@ int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size)
pc->frame_start_found=1; pc->frame_start_found=1;
break; break;
} }
if(state == SEQ_END_CODE){
pc->state=-1;
return i+1;
}
} }
} }
...@@ -2196,7 +2200,7 @@ static int mpeg_decode_frame(AVCodecContext *avctx, ...@@ -2196,7 +2200,7 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
MpegEncContext *s2 = &s->mpeg_enc_ctx; MpegEncContext *s2 = &s->mpeg_enc_ctx;
dprintf(avctx, "fill_buffer\n"); 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 */ /* special case for last picture */
if (s2->low_delay==0 && s2->next_picture_ptr) { if (s2->low_delay==0 && s2->next_picture_ptr) {
*picture= *(AVFrame*)s2->next_picture_ptr; *picture= *(AVFrame*)s2->next_picture_ptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment