--- branches/release-1_0-branch/xvidcore/examples/xvid_decraw.c 2004/04/14 19:51:06 1429 +++ branches/release-1_0-branch/xvidcore/examples/xvid_decraw.c 2004/04/15 10:04:55 1430 @@ -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.10.2.2 2004-04-10 10:05:47 edgomez Exp $ + * $Id: xvid_decraw.c,v 1.10.2.3 2004-04-15 10:04:55 suxen_drol Exp $ * ****************************************************************************/ @@ -88,7 +88,9 @@ xvid_dec_stats_t *xvid_dec_stats); static int dec_stop(); static void usage(); - +int write_image(char *prefix, unsigned char *image); +int write_pnm(char *filename, unsigned char *image); +int write_tga(char *filename, unsigned char *image); const char * type2str(int type) { @@ -178,6 +180,12 @@ } } +#if defined(_MSC_VER) + if (ARG_INPUTFILE==NULL) { + fprintf(stderr, "Warning: MSVC build does not read EOF correctly from stdin. Use the -i switch.\n\n"); + } +#endif + /***************************************************************************** * Values checking ****************************************************************************/ @@ -378,7 +386,7 @@ sprintf(filename, "%sdec%05d", filepath, filenr); if(write_image(filename, out_buffer)) { fprintf(stderr, - "Error writing decoded PGM frame %s\n", + "Error writing decoded frame %s\n", filename); } } @@ -391,11 +399,14 @@ * Calculate totals and averages for output, print results ****************************************************************************/ - totalsize /= filenr; - totaldectime /= filenr; - - printf("Avg: dectime(ms) =%7.2f, fps =%7.2f, length(bytes) =%7d\n", - totaldectime, 1000/totaldectime, (int)totalsize); + if (filenr>0) { + totalsize /= filenr; + totaldectime /= filenr; + printf("Avg: dectime(ms) =%7.2f, fps =%7.2f, length(bytes) =%7d\n", + totaldectime, 1000/totaldectime, (int)totalsize); + }else{ + printf("Nothing was decoded!\n"); + } /***************************************************************************** * XviD PART Stop