changeset 35325:d462bb933886

Do not attempt to write into a file if opening it failed.
author reimar
date Sat, 10 Nov 2012 18:52:13 +0000
parents 0967f7988a01
children 79e7ec4662ee
files libmpcodecs/ve_xvid4.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ve_xvid4.c	Sat Nov 10 18:48:41 2012 +0000
+++ b/libmpcodecs/ve_xvid4.c	Sat Nov 10 18:52:13 2012 +0000
@@ -1378,8 +1378,7 @@
 			mod->max_framenum = mod->frames;
 		}
 
-		if (xvidenc_psnr) {
-			if (!mod->fvstats) {
+		if (xvidenc_psnr && !mod->fvstats) {
 				char filename[20];
 				time_t today2;
 				struct tm *today;
@@ -1392,7 +1391,8 @@
 					/* Disable PSNR file output so we don't get here again */
 					xvidenc_psnr = 0;
 				}
-			}
+		}
+		if (xvidenc_psnr) {
 			fprintf (mod->fvstats, "%6d, %2d, %6d, %2.2f, %2.2f, %2.2f, %2.2f %c\n",
 					mod->frames,
 					stats->quant,