--- branches/dev-api-4/xvidcore/src/decoder.c 2003/02/22 08:49:45 890 +++ branches/dev-api-4/xvidcore/src/decoder.c 2003/03/26 10:29:51 945 @@ -19,7 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: decoder.c,v 1.49.2.1 2003-02-22 08:49:44 suxen_drol Exp $ + * $Id: decoder.c,v 1.49.2.3 2003-03-26 10:29:51 suxen_drol Exp $ * ****************************************************************************/ @@ -1705,16 +1705,6 @@ #endif } -/* swap two MACROBLOCK array */ -void -mb_swap(MACROBLOCK ** mb1, - MACROBLOCK ** mb2) -{ - MACROBLOCK *temp = *mb1; - - *mb1 = *mb2; - *mb2 = temp; -} /* perform post processing if necessary, and output the image */ @@ -1764,18 +1754,21 @@ if (frame->length < 0) /* decoder flush */ { + int ret; /* if not decoding "low_delay/packed", and this isn't low_delay and we have a reference frame, then outout the reference frame */ - if (!(dec->low_delay_default && dec->packed_mode) && !dec->low_delay && dec->frames>0) - { + if (!(dec->low_delay_default && dec->packed_mode) && !dec->low_delay && dec->frames>0) { decoder_output(dec, &dec->refn[0], dec->last_mbs, frame, stats, dec->last_coding_type); + dec->frames = 0; + ret = 0; }else{ if (stats) stats->type = XVID_TYPE_NOTHING; + ret = XVID_ERR_END; } emms(); stop_global_timer(); - return 0; + return ret; } BitstreamInit(&bs, frame->bitstream, frame->length); @@ -1892,7 +1885,7 @@ image_swap(&dec->refn[0], &dec->refn[1]); image_swap(&dec->cur, &dec->refn[0]); - mb_swap(&dec->mbs, &dec->last_mbs); + SWAP(MACROBLOCK *, dec->mbs, dec->last_mbs); dec->last_reduced_resolution = reduced_resolution; dec->last_coding_type = coding_type;