[FFmpeg-devel] [PATCH] mov reference files search improvement

Baptiste Coudurier baptiste.coudurier
Mon Nov 16 20:02:15 CET 2009


On 11/16/2009 02:13 AM, Reimar D?ffinger wrote:
> On Mon, Nov 16, 2009 at 11:05:54AM +0100, Diego Biurrun wrote:
>> On Fri, Sep 25, 2009 at 10:07:19AM +0300, Maksym Veremeyenko wrote:
>>> Diego Biurrun ???????(??):
>>>> On Wed, Sep 23, 2009 at 08:48:48AM +0300, Maksym Veremeyenko wrote:
>>>>> Please, comment, commit or reject.
>>>>>
>>>>> --- libavformat/mov.c.step1	2009-09-10 08:47:11.000000000 +0300
>>>>> +++ libavformat/mov.c	2009-09-18 09:24:41.000000000 +0300
>>>>> @@ -1542,6 +1542,56 @@
>>>>>
>>>>> +        /* find a source dir */
>>>>> +#ifdef __MINGW32__
>>>>> +        src_path = FFMAX(strrchr(src, '/'), strrchr(src, '\\'));
>>>>> +#else
>>>>> +        src_path = strrchr(src, '/');
>>>>> +#endif
>>>>
>>>> There must be a way to achieve this without ugly #ifdefs.
>>> There is a way to use *dirname* but according to man:
>>> /.../
>>> There is no GNU version of dirname()
>>> /.../
>>> and even if will be used it require temporary storage because of:
>>> /.../
>>> Both  dirname() and basename() may modify the contents
>>> /.../
>>> so either accept ugly #ifdefs or give me a hint....
>>
>> Either find out what the path separator is in configure and test for
>> that instead of __MINGW32__ (which is out of the question) or pass a
>> copy to dirname so that modification is not a problem.
>
> Honestly, all of those are just wrong IMO.

No.

> How a file is played should not depend on the operating system FFmpeg
> was compiled for.

That's not the case.

> Either '\' is a valid path separator for MOV, then the __MINGW32__
> formula must be used everywhere and all '\' must be replaced by '/',
> or it is not, then the lower version must be used everywhere, or both
> is valid (how likely is that? Apple themselves would have issues with
> their OSX and Windows QuickTime versions differing), then some kind
> of auto-detection is necessary, but certainly not based on which OS
> FFmpeg is running on.

This is about alias record structure, and in case you didn't read the 
code, the directory separator stored is ':'.
It then translates the path to open depending on the _running_ operating 
system.

In the code we translate to '/', but if we are on windows we should 
translate to something else.

-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list