diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-08-02 20:49:42 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-08-02 20:49:42 +0000 |
commit | 392b748293deb83e3eb80cb5388ac6cc7239714e (patch) | |
tree | b83d308d56b96fc826ac89755bb4db757c746b05 /libavcodec/mpeg12.c | |
parent | 61eade27bd1886c125337ba106113b4548d03b24 (diff) | |
download | ffmpeg-392b748293deb83e3eb80cb5388ac6cc7239714e.tar.gz |
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
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r-- | libavcodec/mpeg12.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index a370d7d458..e62827a416 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -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; |