--- trunk/xvidcore/examples/xvid_decraw.c 2005/08/01 10:53:46 1627 +++ trunk/xvidcore/examples/xvid_decraw.c 2005/11/25 12:07:01 1658 @@ -20,7 +20,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: xvid_decraw.c,v 1.20 2005-08-01 10:53:46 Isibaar Exp $ + * $Id: xvid_decraw.c,v 1.23 2005-11-25 12:07:01 chl Exp $ * ****************************************************************************/ @@ -73,6 +73,8 @@ static const int display_buffer_bytes = 0; +#define MIN_USEFUL_BYTES 1 + /***************************************************************************** * Local prototypes ****************************************************************************/ @@ -333,7 +335,7 @@ if (display_buffer_bytes) { printf("Data chunk %d: %d bytes consumed, %d bytes in buffer\n", chunk++, used_bytes, useful_bytes); } - } while (xvid_dec_stats.type <= 0 && useful_bytes > 0); + } while (xvid_dec_stats.type <= 0 && useful_bytes > MIN_USEFUL_BYTES); /* Check if there is a negative number of useful bytes left in buffer * This means we went too far */ @@ -378,7 +380,7 @@ filenr++; - } while (useful_bytes>0 || !feof(in_file)); + } while (useful_bytes>MIN_USEFUL_BYTES || !feof(in_file)); useful_bytes = 0; /* Empty buffer */ @@ -495,7 +497,7 @@ #else clock_t clk; clk = clock(); - return(clk * 1000 / CLOCKS_PER_SEC); + return(clk * 1000.0 / CLOCKS_PER_SEC); #endif } @@ -623,7 +625,7 @@ if (BPP == 1) { int i; - fprintf(f, "P5\n#xvid\n%i %i\n255\n", XDIM, YDIM*3/2); + fprintf(f, "P5\n%i %i\n255\n", XDIM, YDIM*3/2); fwrite(image, 1, XDIM*YDIM, f);