[FFmpeg-devel] [PATCH] small metadata API modifications

Aurelien Jacobs aurel
Sun Jan 18 23:55:05 CET 2009


Michael Niedermayer wrote:

> On Sun, Jan 18, 2009 at 07:26:56PM +0100, Aurelien Jacobs wrote:
> > Hi,
> > 
> > I've started looking at conversion of various (de)muxers to the new
> > metadata API. From this experience, I found 2 small problems in
> > the new metadata API. Well, not really problems... more like ugliness.
> > 
> >  - Almost all calls to av_metadata_get() will use the flag
> >    AV_METADATA_IGNORE_CASE. This creates extra long lines and makes
> >    the code harder to read almost everywhere.
> >    I propose to replace this flag by the opposit one: AV_METADATA_MATCH_CASE.
> >    There is no functionnal change, but most call to av_metadata_get()
> >    can just set flags to 0.
> 
> ok

Applied.

> >  - av_metadata_set() currently requires an AVMetadataTag as parameter.
> >    Most use case looks like this:
> >    av_metadata_set(&s->metadata, (const AVMetadataTag){"title", value});
> >    IMO this hurts readability, and moreover, this generates a warning
> >    (demoting const from "title").
> >    I propose to replace this by:
> >    av_metadata_set(&s->metadata, "title", value);
> >    It is smaller, more readable, more natural and has no const
> >    missmatch problem.
> 
> iam less happy about this, but fine if you want it

OK. I will work a bit more on (de)muxers code before deciding weather
I commit this one or not.

Aurel




More information about the ffmpeg-devel mailing list