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

Reimar Döffinger Reimar.Doeffinger
Tue Nov 17 01:30:54 CET 2009


On Mon, Nov 16, 2009 at 11:02:15AM -0800, Baptiste Coudurier wrote:
> On 11/16/2009 02:13 AM, Reimar D?ffinger wrote:
> > 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.

I think I still didn't manage to understand your explanation, however
the point is that the code that is under __MINGW32__ does not process
the drefs but the "current file name", sorry for the messup.
In that case I only have a few different comments:
1) src argument to mov_open_dref should be "const char *"
2) c->fc->filename == NULL should not crash
3) I see no reason to calculate src_path inside the loop, even the
   > memcpy(filename, src, src_path - src);
   could be outside I think.
4) I think this would be closer to correct:
src_path = strrchr(src, '/');
#if HAVE_DOS_PATHS
src_path = FFMAX(src_path, strrchr(src, '\\'));
src_path = FFMAX(src_path, strrchr(src, ':'));
#endif

However, it relies on any NULL < any valid pointer being true, whereas I
think according to the standard such a comparison is actually undefined.



More information about the ffmpeg-devel mailing list