OSDN Git Service

- mingw fixes to use fopen() with 'b' flag.
authorkonablend <konablend@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 6 Jun 2009 23:04:51 +0000 (23:04 +0000)
committerkonablend <konablend@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 6 Jun 2009 23:04:51 +0000 (23:04 +0000)
- include pthread.h for pthread_win32 attach/detach decls.

git-svn-id: svn://localhost/HandBrake/trunk@2495 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/hb.c
libhb/scan.c
libhb/stream.c
test/test.c

index 7d140bd..26826ec 100644 (file)
@@ -443,7 +443,7 @@ void hb_get_preview( hb_handle_t * h, hb_title_t * title, int picture,
     hb_get_tempory_filename( h, filename, "%" PRIxPTR "%d",
                              (intptr_t) title, picture );
 
-    file = fopen( filename, "r" );
+    file = fopen( filename, "rb" );
     if( !file )
     {
         hb_log( "hb_get_preview: fopen failed" );
index 6ff83a8..1d62297 100644 (file)
@@ -600,7 +600,7 @@ static int DecodePreviews( hb_scan_t * data, hb_title_t * title )
             hb_get_tempory_filename( data->h, filename, "%" PRIxPTR "%d",
                                      (intptr_t)title, i );
 
-            file_preview = fopen( filename, "w" );
+            file_preview = fopen( filename, "wb" );
             if( file_preview )
             {
                 fwrite( vid_buf->data, title->width * title->height * 3 / 2,
index c98f901..92907e1 100644 (file)
@@ -470,7 +470,7 @@ static int audio_inactive( hb_stream_t *stream, int indx )
  **********************************************************************/
 hb_stream_t * hb_stream_open( char *path, hb_title_t *title )
 {
-    FILE *f = fopen( path, "r" );
+    FILE *f = fopen( path, "rb" );
     if ( f == NULL )
     {
         hb_log( "hb_stream_open: open %s failed", path );
index 94404d2..b9681c3 100644 (file)
 #include <unistd.h>
 #include <inttypes.h>
 
+#ifdef PTW32_STATIC_LIB
+#include <pthread.h>
+#endif
+
 #include "hb.h"
 #include "parsecsv.h"