# HG changeset patch # User michaelni # Date 1058954282 0 # Node ID b52e62d17bbb472d36cbdabfeb3a8f862ce701c3 # Parent a0c0bee12abf0bc7675abc8d804532ceabafdb2b last frame decoding fix diff -r a0c0bee12abf -r b52e62d17bbb h263dec.c --- a/h263dec.c Wed Jul 23 00:32:50 2003 +0000 +++ b/h263dec.c Wed Jul 23 09:58:02 2003 +0000 @@ -401,9 +401,17 @@ s->flags= avctx->flags; *data_size = 0; - - /* no supplementary picture */ + + /* no supplementary picture */ if (buf_size == 0) { + /* special case for last picture */ + if (s->low_delay==0 && s->next_picture_ptr) { + *pict= *(AVFrame*)s->next_picture_ptr; + s->next_picture_ptr= NULL; + + *data_size = sizeof(AVFrame); + } + return 0; } diff -r a0c0bee12abf -r b52e62d17bbb mpeg12.c --- a/mpeg12.c Wed Jul 23 00:32:50 2003 +0000 +++ b/mpeg12.c Wed Jul 23 09:58:02 2003 +0000 @@ -2231,12 +2231,11 @@ *data_size = 0; /* special case for last picture */ - if (buf_size == 0) { - if (s2->picture_number > 0) { - *picture= *(AVFrame*)&s2->next_picture; + if (buf_size == 0 && s2->low_delay==0 && s2->next_picture_ptr) { + *picture= *(AVFrame*)s2->next_picture_ptr; + s2->next_picture_ptr= NULL; - *data_size = sizeof(AVFrame); - } + *data_size = sizeof(AVFrame); return 0; }