>> +static void update_metadata(HTTPContext *s, char *data)
>> +{
>> + char *key;
>> + char *val;
>> + char *end;
>> + char *next = data;
>> +
>> + while (*next) {
>> + key = next;
>> + val = strstr(key, "='");
>> + if (!val)
>> + break;
>> + end = strstr(val, "';");
>> + if (!end)
>> + break;
>> +
>> + *val = '\0';
>> + *end = '\0';
>> + val += 2;
>> +
>> + av_dict_set(&s->metadata, key, val, 0);
>> +
>> + next = end + 2;
>> + }
>> +}
>
> I'm not sure if this way to parse it always works (I've found ICY
> metadata can be quite inconsistent), but I guess we can give it a try.
> Or did you find anything definitive about the format of this data?
Check out: http://svn.xiph.org/icecast/trunk/icecast/src/format_mp3.c
(function: filter_shoutcast_metadata). They look for a key name
specifically in the metadata, but since we're actually interested in
parsing the key here, it has to be a bit more open-ended.
> Also, your patch is ignoring icy_metadata_headers, which is basically
> per-connection metadata.
Is this data anything that can be shown to a user? IIRC, it's just the
metadata interval, possibly bitrate, and the like.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel