37 static pthread_mutex_t
mutex = PTHREAD_MUTEX_INITIALIZER;
56 pthread_mutex_lock (&
mutex);
60 pthread_mutex_unlock (&
mutex);
67 while ((next = g_queue_peek_head (&
vis_list)))
79 vis_node = g_queue_pop_head (&
vis_list);
82 pthread_mutex_unlock (&
mutex);
95 pthread_mutex_lock (&
mutex);
97 pthread_mutex_unlock (&
mutex);
121 pthread_mutex_lock (&
mutex);
123 pthread_mutex_unlock (&
mutex);
152 pthread_mutex_lock (&
mutex);
154 pthread_mutex_unlock (&
mutex);
160 pthread_mutex_lock (&
mutex);
169 if (current_node && current_node->
channels != channels)
181 int node_time = time;
191 if ((last = g_queue_peek_tail (&
vis_list)))
194 at = channels * (
int) ((int64_t) (node_time - time) * rate / 1000);
201 current_node = g_malloc (
sizeof (
VisNode));
202 current_node->
time = node_time;
203 current_node->
data = g_malloc (
sizeof (
float) * channels * 512);
214 memcpy (current_node->
data + channels *
current_frames, data + at, sizeof (
float) * copy);
217 if (current_frames < 512)
220 g_queue_push_tail (&
vis_list, current_node);
225 pthread_mutex_unlock (&
mutex);
230 pthread_mutex_lock (&
mutex);
233 pthread_mutex_unlock (&
mutex);
void vis_send_clear(void)
static void start_stop(bool_t new_playing, bool_t new_paused)
const char PluginHandle decoder const char PluginHandle decoder const char PluginHandle decoder void const PreferencesWidget int
static int current_frames
static bool_t send_audio(void *unused)
static bool_t send_clear(void *unused)
void vis_runner_start_stop(bool_t new_playing, bool_t new_paused)
void vis_runner_pass_audio(int time, float *data, int samples, int channels, int rate)
int output_get_raw_time(void)
void vis_runner_flush(void)
static VisNode * current_node
static pthread_mutex_t mutex
void vis_send_audio(const float *data, int channels)
void vis_runner_enable(bool_t enable)
static void vis_node_free(VisNode *node)