On Thu, 5 Jun 2014 12:45:20 -0400
Andrew Stone <[email protected]> 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.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to