[FFmpeg-devel] [PATCH] Add writing of vorbis comments to flac files

Aurelien Jacobs aurel
Sat Mar 13 01:00:42 CET 2010


On Fri, Mar 12, 2010 at 02:19:54PM +0100, James Darnley wrote:
> On 12 March 2010 13:44, Aurelien Jacobs <aurel at gnuage.org> wrote:
> > You are not allowed to access to the content of AVMetadata *m by
> > yourself. You must not use anything else than what's described in
> > Public Metadata API (avformat.h).
> > Basically you should use av_metadata_get() to iterate over all the
> > elements.
> > Something like this should do the trick:
> >
> > ?AVMetadataTag *t = NULL;
> > ?while ((t = av_metadata_get(m, "", t, AV_METADATA_IGNORE_SUFFIX))) {
> > ? ? /* do wathever you want with 't' */
> > ?}
> >
> > Aurel
> 
> Ew.  Why isn't there a cleaner method for getting the next tag?

What kind of cleaner method would you expect ?
Are you simply thinking about something like this :

  #define av_metadata_next(m, t) \
          av_metadata_get(m, "", t, AV_METADATA_IGNORE_SUFFIX)

I thougt about something like this while we were designing the API,
but it would only hide the real API... I'm not sure that it's a good
idea.

Aurel



More information about the ffmpeg-devel mailing list