[FFmpeg-devel] [PATCH] small metadata API modifications
Aurelien Jacobs
aurel
Sun Jan 18 19:26:56 CET 2009
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.
- 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.
So those 2 changes are mostly cosmetics, but it really makes the
code nicer (IMO), and we should make such changes before declaring
the API stable.
Aurel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: md_match_case.diff
Type: text/x-diff
Size: 2946 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090118/4b3dea60/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: md_parameters.diff
Type: text/x-diff
Size: 2995 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090118/4b3dea60/attachment-0001.diff>
More information about the ffmpeg-devel
mailing list