[FFmpeg-devel] [PATCH] Binary file access on Windows

Ramiro Ribeiro Polla ramiro
Mon Jun 25 22:35:25 CEST 2007


Michael Niedermayer wrote:
> Hi
>
> On Mon, Jun 25, 2007 at 01:30:45PM -0300, Ramiro Ribeiro Polla wrote:
>   
>> M?ns Rullg?rd wrote:
>>     
>>> Ramiro Ribeiro Polla <ramiro at lisha.ufsc.br> writes:
>>>
>>>   
>>>       
>>>> wrote:
>>>>     
>>>>         
>>>>> Ramiro Ribeiro Polla <ramiro at lisha.ufsc.br> writes:
>>>>>
>>>>>
>>>>>       
>>>>>           
>>>>>> Hello,
>>>>>>
>>>>>> Attached patch checks for features, and not systems, on the code. It's
>>>>>> now left up to configure.
>>>>>>
>>>>>>         
>>>>>>             
>>>>>       
>>>>>           
>>>>>> -#if defined(__MINGW32__) || defined(CONFIG_OS2) || defined(__CYGWIN__)
>>>>>> +#ifdef CONFIG_BINARY_FILE
>>>>>>      access |= O_BINARY;
>>>>>>  #endif
>>>>>>
>>>>>>         
>>>>>>             
>>>>> #ifdef O_BINARY ?
>>>>>
>>>>>       
>>>>>           
>>>> Patch attached.
>>>> Are there any systems that define O_BINARY but don't require it?
>>>>     
>>>>         
>>> Doesn't matter.  It should never do any harm.
>>>
>>>   
>>>       
>>>> Ramiro Polla
>>>> Index: libavformat/file.c
>>>> ===================================================================
>>>> --- libavformat/file.c	(revision 9389)
>>>> +++ libavformat/file.c	(working copy)
>>>> @@ -40,7 +40,7 @@
>>>>      } else {
>>>>          access = O_RDONLY;
>>>>      }
>>>> -#if defined(__MINGW32__) || defined(CONFIG_OS2) || defined(__CYGWIN__)
>>>> +#ifdef O_BINARY
>>>>      access |= O_BINARY;
>>>>  #endif
>>>>      fd = open(filename, access, 0666);
>>>> @@ -95,7 +95,7 @@
>>>>      } else {
>>>>          fd = 0;
>>>>      }
>>>> -#if defined(__MINGW32__) || defined(CONFIG_OS2) || defined(__CYGWIN__)
>>>> +#ifdef O_BINARY
>>>>      setmode(fd, O_BINARY);
>>>>  #endif
>>>>      h->priv_data = (void *)(size_t)fd;
>>>>     
>>>>         
>>> Looks OK to me.  Who is maintainer of file.c?
>>>       
>
> iam maintainer of everything where noone else is :(
>
>
>   
>>>   
>>>       
>> It seems like no one is... Ok to apply anyways?
>>     
>
> patch ok
>
>   

Applied.





More information about the ffmpeg-devel mailing list