Hi,

On Fri, Jan 6, 2012 at 10:08 AM, Paul B Mahol <[email protected]> wrote:
> On 1/6/12, Paul B Mahol <[email protected]> wrote:
>> On 1/6/12, Ronald S. Bultje <[email protected]> wrote:
>>> Hi,
>>>
>>> On Fri, Jan 6, 2012 at 9:18 AM, Paul B Mahol <[email protected]> wrote:
>>>> ---
>>>>  libavformat/vqf.c |   42 ++++++++++++++++++++++++++++++++++++++++++
>>>>  1 files changed, 42 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/libavformat/vqf.c b/libavformat/vqf.c
>>>> index 3e79299..608ecbd 100644
>>>> --- a/libavformat/vqf.c
>>>> +++ b/libavformat/vqf.c
>>>> @@ -140,6 +140,48 @@ static int vqf_read_header(AVFormatContext *s,
>>>> AVFormatParameters *ap)
>>>>         case MKTAG('G','E','N','R'):
>>>>             add_metadata(s, "genre"    , len, header_size);
>>>>             break;
>>>> +        case MKTAG('L','Y','R','C'):
>>>> +            add_metadata(s, "lyrics"   , len, header_size);
>>>> +            break;
>>>> +        case MKTAG('G','U','I','D'):
>>>> +            add_metadata(s, "GUID"     , len, header_size);
>>>> +            break;
>>>> +        case MKTAG('I','S','R','C'):
>>>> +            add_metadata(s, "ISRC"     , len, header_size);
>>>> +            break;
>>>
>>> I'm probably being a pain, but wouldn't a nice loop over a table
>>> matching fourcc-tag to metadata-string-tag lead to much less code?
>>
>> Probably, patch on hold.
>>
>
> This would need more work with no much gain IMHO.

Not that much work:

static const struct {
    uint32_t fcc;
    char *str;
} meta_conv_table[] = {
    { MKTAG(...), "..." },
    ..,
    { 0, NULL },
};

for (n = 0; meta_conv_table[n].fcc; n++) {
    if (meta_conv_table[n].fcc == switch_fourcc)) {
        add_metadata(s, meta_conv_table[n].str, len, header_size);
        break;
    }
}

Ronald
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to