# HG changeset patch # User William Pitcock # Date 1240828782 18000 # Node ID 3f023c46e40cf7cec00e32ca7e67062ecd406bef # Parent d58963762734ae2f294f5da5ab80c9a0a42811da neon: Add support for icy-br. diff -r d58963762734 -r 3f023c46e40c src/neon/neon.c --- a/src/neon/neon.c Mon Apr 27 04:47:07 2009 -0500 +++ b/src/neon/neon.c Mon Apr 27 05:39:42 2009 -0500 @@ -466,6 +466,14 @@ h->icy_metadata.stream_name = g_strdup(value); } + if (neon_strcmp(name, "icy-br")) { + /* + * The server sent us a bitrate. We might want to use it. + */ + _DEBUG("ICY bitrate: %d", atoi(value); + h->icy_metadata.stream_bitrate = atoi(value); + } + continue; } @@ -1364,6 +1372,10 @@ _LEAVE g_strdup(h->icy_metadata.stream_contenttype); } + if (neon_strcmp(field, "content-bitrate")) { + _LEAVE g_strdup_printf("%d", h->icy_metadata.stream_bitrate * 1000); + } + _LEAVE NULL; } diff -r d58963762734 -r 3f023c46e40c src/neon/neon.h --- a/src/neon/neon.h Mon Apr 27 04:47:07 2009 -0500 +++ b/src/neon/neon.h Mon Apr 27 05:39:42 2009 -0500 @@ -49,6 +49,7 @@ gchar* stream_title; gchar* stream_url; gchar* stream_contenttype; + gint stream_bitrate; }; struct neon_handle {