From 44d9f62f34e0561d83ea32941f0ea1b529b1490d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 16 Aug 2008 09:28:15 -0700 Subject: core rewrite (decode,player,outputBuffer,playlist) This is a huge refactoring of the core mpd process. The queueing/buffering mechanism is heavily reworked. The player.c code has been merged into outputBuffer (the actual ring buffering logic is handled by ringbuf.c); and decode.c actually handles decoding stuff. The end result is several hundreds of lines shorter, even though we still have a lot of DEBUG statements left in there for tracing and a lot of assertions, too. --- src/inputStream_http.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/inputStream_http.c') diff --git a/src/inputStream_http.c b/src/inputStream_http.c index 48972ac8b..a6c715459 100644 --- a/src/inputStream_http.c +++ b/src/inputStream_http.c @@ -252,7 +252,7 @@ static int trigger_action(struct http_data *data, goto out; } if (nonblocking) - cond_timedwait(&data->action_cond, 1); + cond_timedwait(&data->action_cond, 100); else cond_wait(&data->action_cond); ret = 0; @@ -279,7 +279,7 @@ static int take_action(struct http_data *data) xclose(data->fd); data->fd = -1; data->action = CONN_ACTION_NONE; - cond_signal_sync(&data->action_cond); + cond_signal(&data->action_cond); cond_leave(&data->action_cond); return 1; } @@ -436,7 +436,7 @@ static void await_buffer_space(struct http_data *data) static void feed_starved(struct http_data *data) { assert(pthread_equal(data->io_thread, pthread_self())); - cond_signal_async(&data->empty_cond); + cond_signal(&data->empty_cond); } static int starved_wait(struct http_data *data, const long sec) @@ -449,7 +449,7 @@ static int awaken_buffer_task(struct http_data *data) { assert(!pthread_equal(data->io_thread, pthread_self())); - return ! cond_signal_async(&data->full_cond); + return ! cond_signal_trysync(&data->full_cond); } static ssize_t buffer_data(InputStream *is) -- cgit v1.2.3