]> git.sesse.net Git - mlt/commitdiff
Fix reading binary files on Windows.
authorDan Dennedy <dan@dennedy.org>
Tue, 25 Mar 2014 03:52:57 +0000 (20:52 -0700)
committerDan Dennedy <dan@dennedy.org>
Tue, 25 Mar 2014 03:52:57 +0000 (20:52 -0700)
src/modules/core/transition_composite.c
src/modules/core/transition_luma.c
src/modules/dv/consumer_libdv.c
src/modules/vmfx/producer_pgm.c
src/modules/vorbis/producer_vorbis.c

index cd0183b5bdd2be088622084d1867001b55bb9ac2..9b9eada2d55c224e29650e13f37b2a640f47706d 100644 (file)
@@ -674,7 +674,7 @@ static uint16_t* get_luma( mlt_transition self, mlt_properties properties, int w
                        if ( extension != NULL && strcmp( extension, ".pgm" ) == 0 )
                        {
                                // Open PGM
-                               FILE *f = fopen( resource, "r" );
+                               FILE *f = fopen( resource, "rb" );
                                if ( f != NULL )
                                {
                                        // Load from PGM
index c3263da25b78a620a5984af2c424f52657195085..224511f7de467a6599beb9723936bcf050619786 100644 (file)
@@ -367,7 +367,7 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
                if ( extension != NULL && strcmp( extension, ".pgm" ) == 0 )
                {
                        // Open PGM
-                       FILE *f = fopen( resource, "r" );
+                       FILE *f = fopen( resource, "rb" );
                        if ( f != NULL )
                        {
                                // Load from PGM
index 3a9949c277ed7683dbc39ae8d7af9df3c6106887..916c36f5f33792263edf337e8a24461dcfb05844 100644 (file)
@@ -343,7 +343,7 @@ static void consumer_output( mlt_consumer this, uint8_t *dv_frame, int size, mlt
                output = mlt_properties_get_data( properties, "output_file", NULL );
                if ( output == NULL )
                {
-                       output = fopen( target, "w" );
+                       output = fopen( target, "wb" );
                        if ( output != NULL )
                                mlt_properties_set_data( properties, "output_file", output, 0, ( mlt_destructor )fclose, 0 );
                }
index 5a74fa036ec896d450b9ae0f97f41d652102dd5c..c0b342c2920623c9907ed34dd949ae12e108e77b 100644 (file)
@@ -66,7 +66,7 @@ static int read_pgm( char *name, uint8_t **image, int *width, int *height, int *
 {
        uint8_t *input = NULL;
        int error = 0;
-       FILE *f = fopen( name, "r" );
+       FILE *f = fopen( name, "rb" );
        char data[ 512 ];
 
        // Initialise
index 920108627f500d495535dadf00d1080b17e61a0e..72f38917daa70332b7cb088c59b418c7697b85c5 100644 (file)
@@ -124,7 +124,7 @@ static void producer_file_close( void *file )
 static int producer_open( mlt_producer this, mlt_profile profile, char *file )
 {
        // FILE pointer for file
-       FILE *input = fopen( file, "r" );
+       FILE *input = fopen( file, "rb" );
 
        // Error code to return
        int error = input == NULL;