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

j at svn.xiph.org j at svn.xiph.org
Thu Jan 28 01:30:22 PST 2010


Author: j
Date: 2010-01-28 01:30:22 -0800 (Thu, 28 Jan 2010)
New Revision: 16841

Modified:
   trunk/ffmpeg2theora/src/avinfo.c
   trunk/ffmpeg2theora/src/ffmpeg2theora.c
   trunk/ffmpeg2theora/src/theorautils.c
Log:
dont use tmpfile on windows, it creates a file in c:\, some more changes to cross compile

Modified: trunk/ffmpeg2theora/src/avinfo.c
===================================================================
--- trunk/ffmpeg2theora/src/avinfo.c	2010-01-28 08:03:46 UTC (rev 16840)
+++ trunk/ffmpeg2theora/src/avinfo.c	2010-01-28 09:30:22 UTC (rev 16841)
@@ -43,9 +43,11 @@
 
 #include "libavformat/avformat.h"
 
+#ifndef WIN32
 #if !defined(off64_t)
 #define off64_t off_t
 #endif
+#endif
 
 #ifdef WIN32
 #define fseeko fseeko64

Modified: trunk/ffmpeg2theora/src/ffmpeg2theora.c
===================================================================
--- trunk/ffmpeg2theora/src/ffmpeg2theora.c	2010-01-28 08:03:46 UTC (rev 16840)
+++ trunk/ffmpeg2theora/src/ffmpeg2theora.c	2010-01-28 09:30:22 UTC (rev 16841)
@@ -2089,6 +2089,8 @@
     };
 
     char pidfile_name[255] = { '\0' };
+    char _tmp_2pass[1024] = { '\0' };
+
     FILE *fpid = NULL;
 
     ff2theora convert = ff2theora_init();
@@ -2121,7 +2123,14 @@
                             break;
                         case TWOPASS_FLAG:
                             info.twopass = 3;
+#ifdef WIN32
+                            srand (time (NULL));
+                            sprintf(_tmp_2pass, "%s\\f2t_%06d.log", getenv("TEMP"), rand());
+                            fprintf(stderr, "%s\n", _tmp_2pass);
+                            info.twopass_file = fopen(_tmp_2pass,"wb+");
+#else
                             info.twopass_file = tmpfile();
+#endif
                             if(!info.twopass_file){
                                 fprintf(stderr,"Unable to open temporary file for twopass data\n");
                                 exit(1);
@@ -2719,5 +2728,9 @@
         fprintf(info.frontend, "{\"result\": \"ok\"}\n");
     if (info.frontend && info.frontend != stderr)
         fclose(info.frontend);
+#ifdef WIN32
+    if (info.twopass==3)
+        unlink(_tmp_2pass);
+#endif
     return(0);
 }

Modified: trunk/ffmpeg2theora/src/theorautils.c
===================================================================
--- trunk/ffmpeg2theora/src/theorautils.c	2010-01-28 08:03:46 UTC (rev 16840)
+++ trunk/ffmpeg2theora/src/theorautils.c	2010-01-28 09:30:22 UTC (rev 16841)
@@ -30,9 +30,11 @@
 #define _FILE_OFFSET_BITS 64
 #endif
 
+#ifndef WIN32
 #if !defined(off64_t)
 #define off64_t off_t
 #endif
+#endif
 
 #ifdef WIN32
 #define fseeko fseeko64



More information about the commits mailing list