[xiph-commits] r16846 - trunk/ffmpeg2theora/src

j at svn.xiph.org j at svn.xiph.org
Thu Jan 28 22:33:15 PST 2010


Author: j
Date: 2010-01-28 22:33:14 -0800 (Thu, 28 Jan 2010)
New Revision: 16846

Modified:
   trunk/ffmpeg2theora/src/ffmpeg2theora.c
Log:
fall back to TMP if TEMP is not defined, fixes 2 pass file for some windows versions

Modified: trunk/ffmpeg2theora/src/ffmpeg2theora.c
===================================================================
--- trunk/ffmpeg2theora/src/ffmpeg2theora.c	2010-01-28 19:56:52 UTC (rev 16845)
+++ trunk/ffmpeg2theora/src/ffmpeg2theora.c	2010-01-29 06:33:14 UTC (rev 16846)
@@ -2124,9 +2124,15 @@
                         case TWOPASS_FLAG:
                             info.twopass = 3;
 #ifdef WIN32
-                            srand (time (NULL));
-                            sprintf(_tmp_2pass, "%s\\f2t_%06d.log", getenv("TEMP"), rand());
-                            info.twopass_file = fopen(_tmp_2pass,"wb+");
+                            {
+                              char *tmp;
+                              srand (time (NULL));
+                              tmp = getenv("TEMP");
+                              if (!tmp) tmp = getenv("TMP");
+                              if (!tmp) tmp = ".";
+                              snprintf(_tmp_2pass, sizeof(_tmp_2pass), "%s\\f2t_%06d.log", tmp, rand());
+                              info.twopass_file = fopen(_tmp_2pass,"wb+");
+                            }
 #else
                             info.twopass_file = tmpfile();
 #endif



More information about the commits mailing list