[FFmpeg-devel] [PATCH] [libavformat/mov.c] Read the QT Metadata Keys only once

Thierry Foucu tfoucu at gmail.com
Thu May 14 20:19:20 EEST 2020


On Thu, May 14, 2020 at 5:09 AM Derek Buitenhuis <derek.buitenhuis at gmail.com>
wrote:

> On 11/05/2020 17:35, Thierry Foucu wrote:
> > If you have a file with multiple Metadata Keys, the second time you parse
> > the keys, you will re-alloc c->meta_keys without freeing the old one.
> > This change will avoid parsing all the consecutive Metadata keys.
> > ---
> >  libavformat/mov.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
>
> Is it correct behavior to skip sunsequent ones entirely (per QTFF spec)?
>

Looking at
https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/Metadata/Metadata.html
The spec does not seem to say 1 or more. But because the `keys` atom is a
list of indexes used by the `ilst` and the spec for `keys` said:
Indexes into the metadata item keys atom are 1-based (1…entry_count).

having 2+ `keys` atoms will conflict with this, as which one will be index 1

I'm assuming that only `keys` could only work.
instead of skipping the consecutive `keys` atom, I could change the code to
free the keys and re-alloc it for each `keys` atom found. So you will get
only the data from the last `keys` atom.

so, it is either the 1st `keys` or the last `keys`. Up to you.



> - Derek
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".



-- 

Thierry Foucu


More information about the ffmpeg-devel mailing list