Commit f6f31cdc authored by Karl Heyes's avatar Karl Heyes
Browse files

*** empty log message ***

svn path=/trunk/icecast/; revision=5863
parent 7371d0ab
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "xslt.h" #include "xslt.h"
#include "format.h" #include "format.h"
#include "format_mp3.h"
#include "logging.h" #include "logging.h"
#ifdef _WIN32 #ifdef _WIN32
...@@ -642,7 +641,7 @@ static void command_metadata(client_t *client, source_t *source) ...@@ -642,7 +641,7 @@ static void command_metadata(client_t *client, source_t *source)
{ {
char *action; char *action;
char *value; char *value;
mp3_state *state; format_plugin_t *format;
#ifdef USE_YP #ifdef USE_YP
int i; int i;
time_t current_time; time_t current_time;
...@@ -653,27 +652,28 @@ static void command_metadata(client_t *client, source_t *source) ...@@ -653,27 +652,28 @@ static void command_metadata(client_t *client, source_t *source)
COMMAND_REQUIRE(client, "mode", action); COMMAND_REQUIRE(client, "mode", action);
COMMAND_REQUIRE(client, "song", value); COMMAND_REQUIRE(client, "song", value);
if(source->format->type != FORMAT_TYPE_MP3) { format = source->format;
client_send_400(client, "Not mp3, cannot update metadata"); if (format->type != FORMAT_TYPE_MP3)
{
client_send_400 (client, "Not mp3, cannot update metadata");
return; return;
} }
if(strcmp(action, "updinfo") != 0) { if (strcmp (action, "updinfo") != 0)
client_send_400(client, "No such action"); {
client_send_400 (client, "No such action");
return; return;
} }
if (format->set_tag)
state = source->format->_state; {
if (value)
thread_mutex_lock(&(state->lock)); format->set_tag (format, "title", value);
free(state->metadata); }
state->metadata = strdup(value);
state->metadata_age++;
thread_mutex_unlock(&(state->lock));
DEBUG2("Metadata on mountpoint %s changed to \"%s\"", DEBUG2("Metadata on mountpoint %s changed to \"%s\"",
source->mount, value); source->mount, value);
stats_event(source->mount, "title", value); stats_event(source->mount, "title", value);
#ifdef USE_YP #ifdef USE_YP
/* If we get an update on the mountpoint, force a /* If we get an update on the mountpoint, force a
yp touch */ yp touch */
...@@ -684,7 +684,6 @@ static void command_metadata(client_t *client, source_t *source) ...@@ -684,7 +684,6 @@ static void command_metadata(client_t *client, source_t *source)
} }
#endif #endif
html_success(client, "Metadata update successful"); html_success(client, "Metadata update successful");
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment