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

Reimar Döffinger Reimar.Doeffinger
Mon Nov 16 11:13:11 CET 2009


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.
How a file is played should not depend on the operating system FFmpeg
was compiled for.
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.



More information about the ffmpeg-devel mailing list