# HG changeset patch # User Matti Hamalainen # Date 1190329266 -10800 # Node ID 8dd3274ec57e5a3f47b1c5c3820f914337b64242 # Parent 3c43d2d5acd9fc9ccc6789b729e52117ac03f365# Parent 99e468c53dff8dd184b656b5a6f5950df2a2edda Automated merge with ssh://hg.atheme.org//hg/audacious-plugins diff -r 3c43d2d5acd9 -r 8dd3274ec57e src/alsa/alsa.c --- a/src/alsa/alsa.c Fri Sep 21 02:00:40 2007 +0300 +++ b/src/alsa/alsa.c Fri Sep 21 02:01:06 2007 +0300 @@ -55,8 +55,4 @@ free(alsa_cfg.mixer_device); alsa_cfg.mixer_device = NULL; } - - /* release our mutex */ - g_mutex_free(alsa_mutex); - alsa_mutex = NULL; } diff -r 3c43d2d5acd9 -r 8dd3274ec57e src/alsa/alsa.h --- a/src/alsa/alsa.h Fri Sep 21 02:00:40 2007 +0300 +++ b/src/alsa/alsa.h Fri Sep 21 02:01:06 2007 +0300 @@ -81,6 +81,6 @@ int alsa_get_written_time(void); void alsa_tell(AFormat * fmt, gint * rate, gint * nch); -extern GMutex *alsa_mutex; +extern GStaticMutex alsa_mutex; #endif diff -r 3c43d2d5acd9 -r 8dd3274ec57e src/alsa/audio.c --- a/src/alsa/audio.c Fri Sep 21 02:00:40 2007 +0300 +++ b/src/alsa/audio.c Fri Sep 21 02:01:06 2007 +0300 @@ -66,7 +66,7 @@ static gboolean pause_request; /* pause status currently requested */ static int flush_request; /* flush status (time) currently requested */ static int prebuffer_size; -GMutex *alsa_mutex; +GStaticMutex alsa_mutex = G_STATIC_MUTEX_INIT; static guint mixer_timeout; @@ -265,7 +265,7 @@ g_thread_join(audio_thread); - g_mutex_lock(alsa_mutex); /* alsa_loop locks alsa_mutex! */ + g_static_mutex_lock(&alsa_mutex); /* alsa_loop locks alsa_mutex! */ alsa_cleanup_mixer(); @@ -284,7 +284,7 @@ snd_output_close(logs); debug("Device closed"); - g_mutex_unlock(alsa_mutex); + g_static_mutex_unlock(&alsa_mutex); } /* reopen ALSA PCM */ @@ -679,7 +679,7 @@ int npfds = snd_pcm_poll_descriptors_count(alsa_pcm); int wr = 0; - g_mutex_lock(alsa_mutex); + g_static_mutex_lock(&alsa_mutex); if (npfds <= 0) goto _error; @@ -716,7 +716,7 @@ } _error: - g_mutex_unlock(alsa_mutex); + g_static_mutex_unlock(&alsa_mutex); alsa_close_pcm(); g_free(thread_buffer); thread_buffer = NULL; @@ -740,7 +740,7 @@ return 0; } - g_mutex_lock(alsa_mutex); + g_static_mutex_lock(&alsa_mutex); if (!mixer) alsa_setup_mixer(); @@ -769,7 +769,7 @@ pause_request = FALSE; flush_request = -1; - g_mutex_unlock(alsa_mutex); + g_static_mutex_unlock(&alsa_mutex); audio_thread = g_thread_create((GThreadFunc)alsa_loop, NULL, TRUE, NULL); return 1; diff -r 3c43d2d5acd9 -r 8dd3274ec57e src/alsa/init.c --- a/src/alsa/init.c Fri Sep 21 02:00:40 2007 +0300 +++ b/src/alsa/init.c Fri Sep 21 02:01:06 2007 +0300 @@ -55,6 +55,4 @@ g_message("Cannot load alsa library: %s", dlerror()); /* FIXME, this plugin wont work... */ } - - alsa_mutex = g_mutex_new(); } diff -r 3c43d2d5acd9 -r 8dd3274ec57e src/neon/neon.c --- a/src/neon/neon.c Fri Sep 21 02:00:40 2007 +0300 +++ b/src/neon/neon.c Fri Sep 21 02:01:06 2007 +0300 @@ -1,3 +1,22 @@ +/* + * A neon HTTP input plugin for Audacious + * Copyright (C) 2007 Ralf Ertzinger + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + #include #include @@ -204,7 +223,7 @@ * End of tag name. */ *p = '\0'; - strcpy(name, tstart); + g_strlcpy(name, tstart, 4096); _DEBUG("Found tag name: %s", name); state = 2; } else { @@ -233,7 +252,7 @@ * End of value */ *p = '\0'; - strcpy(value, tstart); + g_strlcpy(value, tstart, 4096); _DEBUG("Found tag value: %s", value); add_icy(m, name, value); state = 4; @@ -940,7 +959,7 @@ * The maximum number of bytes we can deliver is determined * by the number of bytes left until the next metadata announcement */ - belem = h->icy_metaleft / size; + belem = MIN(used_rb(&h->rb), h->icy_metaleft) / size; } else { belem = used_rb(&h->rb) / size; } diff -r 3c43d2d5acd9 -r 8dd3274ec57e src/neon/neon.h --- a/src/neon/neon.h Fri Sep 21 02:00:40 2007 +0300 +++ b/src/neon/neon.h Fri Sep 21 02:01:06 2007 +0300 @@ -1,3 +1,22 @@ +/* + * A neon HTTP input plugin for Audacious + * Copyright (C) 2007 Ralf Ertzinger + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + #ifndef _NEON_PLUGIN_H #define _NEON_PLUGIN_H diff -r 3c43d2d5acd9 -r 8dd3274ec57e src/neon/rb.c --- a/src/neon/rb.c Fri Sep 21 02:00:40 2007 +0300 +++ b/src/neon/rb.c Fri Sep 21 02:01:06 2007 +0300 @@ -1,3 +1,19 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + /* * Ringbuffer implementation * diff -r 3c43d2d5acd9 -r 8dd3274ec57e src/neon/rb.h --- a/src/neon/rb.h Fri Sep 21 02:00:40 2007 +0300 +++ b/src/neon/rb.h Fri Sep 21 02:01:06 2007 +0300 @@ -1,3 +1,19 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + #ifndef _RB_H #define _RB_H