[FFmpeg-devel] Hello,

Baptiste Coudurier baptiste.coudurier
Thu Jul 16 20:03:28 CEST 2009


Hi,

On Thu, Jul 16, 2009 at 07:53:20PM +0200, Jean-Daniel Dupas wrote:
> Hello,
> 
> I'm new to this list and to this project. I'm looking to use
> libavformat & libavcodec in some application and would like to
> contribute to improve ffmpeg.
> And so, to try to get into the code, I did a little patch to improve
> alias support in dref in mov files on OS X. This patch uses native
> Mac OS X API to resolve the alias if possible instead of trying to
> infer the path from opaque data.
> 
> [...]
>
> @@ -273,6 +278,25 @@
>  
>          if (dref->type == MKTAG('a','l','i','s') && size > 150) {
>              /* macintosh alias record */
> +#if HAVE_CORESERVICES
> +            FSRef target;
> +            OSStatus err;
> +            Boolean updated;
> +            char filePath[MAXPATHLEN];
> +            AliasHandle alias = (AliasHandle)NewHandle(size);
> +            if (!alias)
> +                return AVERROR(ENOMEM);
> +
> +            get_buffer(pb, (void *)*alias, size);
> +            err = FSResolveAliasWithMountFlags(NULL, alias, &target, &updated, kResolveAliasFileNoUI);
> +            if (noErr == err)
> +                err = FSRefMakePath(&target, filePath, MAXPATHLEN);
> +            if (noErr == err) {
> +                av_free(dref->path);
> +                dref->path = av_strdup(filePath);
> +            }
> +            DisposeHandle((Handle)alias);
> +#else 
>              uint16_t volume_len, len;
>              char volume[28];
>              int16_t type;
> @@ -294,6 +318,7 @@
>                  if (len&1)
>                      len += 1;
>                  if (type == 2) { // absolute path
> +                    int j;
>                      av_free(dref->path);
>                      dref->path = av_mallocz(len+1);
>                      if (!dref->path)

Please use the naming convention "file_path" instead of filePath to
match the coding style of the file (for the variables not the API of course),
except that I'm ok with the patch.

Mans, Diego regarding configure ?

I've you are motivated, what would be nice is to have relative path
handling of dref.

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



More information about the ffmpeg-devel mailing list