diff options
author | Viktor Semykin <thesame.ml@gmail.com> | 2009-10-09 14:41:13 +0300 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2009-10-09 20:17:05 +0200 |
commit | 0fee0b8e3140129b9522434dc3b16e3b29cc8aee (patch) | |
tree | 089091ac527938d76776092409cde0924894a305 | |
parent | adf7d4f123ffd7bead738fa33a28db505c10f068 (diff) |
cddb http and proxy support
-rw-r--r-- | plugins/cda/cda.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/plugins/cda/cda.c b/plugins/cda/cda.c index 6bea138f..6df07449 100644 --- a/plugins/cda/cda.c +++ b/plugins/cda/cda.c @@ -28,6 +28,7 @@ static const char *server; static int port; static const char *proxy = NULL; static int proxy_port; +static int proto_cddb = 1; static unsigned int current_sample = 0; @@ -108,6 +109,15 @@ read_config () { proxy_port = atoi (value); } + else if (0 == strcmp (key, "proto")) + { + if (0 == strcmp (value, "cddb")) + proto_cddb = 1; + else if (0 == strcmp (value, "http")) + proto_cddb = 0; + else + fprintf (stderr, "cdaudio: unknown protocol \"%s\"\n", value); + } else fprintf (stderr, "cdaudio: warning, unknown option %s\n", key); } @@ -268,6 +278,16 @@ resolve_disc (CdIo_t *cdio) cddb_set_server_name (conn, server); cddb_set_server_port (conn, port); + if (!proto_cddb) + { + cddb_http_enable (conn); + if (proxy) + { + cddb_set_server_port(conn, proxy_port); + cddb_set_server_name(conn, proxy); + } + } + int matches = cddb_query (conn, disc); if (matches == -1) { |