1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2025-01-03 14:56:34 -05:00

Fix some minor errors.

svn path=/trunk/icecast/; revision=4179
This commit is contained in:
Michael Smith 2002-12-30 11:27:21 +00:00
parent 29bc4a13b6
commit 655a786cfc

View File

@ -63,6 +63,8 @@ format_plugin_t *format_mp3_get_plugin(void)
plugin->_state = state;
state->metadata_age = 0;
state->metadata = strdup("");
thread_mutex_create(&(state->lock));
return plugin;
@ -88,10 +90,13 @@ static int send_metadata(client_t *client, mp3_client_data *client_state,
}
source_age = source_state->metadata_age;
send_metadata = (source_age != client_state->metadata_age) ||
client_state->metadata_offset;
len_byte = send_metadata?(strlen(source_state->metadata)/16 + 1 -
client_state->metadata_offset):0;
send_metadata = source_age != client_state->metadata_age;
if(send_metadata && strlen(source_state->metadata) > 0)
len_byte = strlen(source_state->metadata)/16 + 1 -
client_state->metadata_offset;
else
len_byte = 0;
len = 1 + len_byte*16;
buf = alloca(len);
@ -163,6 +168,8 @@ static void format_mp3_free_plugin(format_plugin_t *self)
/* free the plugin instance */
mp3_state *state = self->_state;
thread_mutex_destroy(&(state->lock));
free(state->metadata);
free(state);
free(self);
}