[libav-devel] [PATCH 3/6] http: export icecast metadata as an option with name "metadata".

Andrew Stone andrew at clovar.com
Fri Jun 6 16:38:14 CEST 2014


On Fri, Jun 6, 2014 at 8:35 AM, wm4 <nfxjfg at googlemail.com> wrote:
> On Thu, 5 Jun 2014 12:45:20 -0400
> Andrew Stone <andrew at clovar.com> wrote:
>
>> >> +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
>
> That's just one implementation. Anyway, I'm not against it, it's
> probably good enough.
>
>> (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.
>
> The metadata interval is stored somewhere else. Yes, there could be
> information the user is interested in. Why hide this information? That
> seems arbitrary.

I just didn't think there was useful data in the headers. I'll go
ahead and include them.


More information about the libav-devel mailing list