summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2009-08-22 20:19:45 +0200
committerGravatar waker <wakeroid@gmail.com>2009-08-22 20:19:45 +0200
commitfbd4f538e224e42a651a3e3ef60e89d3d172f50b (patch)
tree5752e5b77bb8c0937582f62c2b74094b847cce62 /main.c
parentd0b90342f8123aed2cb7b47f7dc9be0e84dcf096 (diff)
fixed commandline issues and deadlock on exit
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/main.c b/main.c
index cf123778..1d2d00a1 100644
--- a/main.c
+++ b/main.c
@@ -300,8 +300,6 @@ server_update (void) {
void
player_thread (uintptr_t ctx) {
prctl (PR_SET_NAME, "deadbeef-player", 0, 0, 0, 0);
- // become a server
- server_start ();
for (;;) {
static int srvupd_count = 0;
if (--srvupd_count <= 0) {
@@ -424,7 +422,6 @@ player_thread (uintptr_t ctx) {
usleep(50000);
update_songinfo ();
}
- server_close ();
}
gboolean
@@ -554,6 +551,9 @@ main (int argc, char *argv[]) {
}
close(s);
+ // become a server
+ server_start ();
+
conf_load ();
pl_load (defpl);
messagepump_init ();
@@ -604,6 +604,7 @@ main (int argc, char *argv[]) {
gtk_widget_show (mainwin);
gtk_main ();
+ server_close ();
gdk_threads_leave ();
messagepump_free ();
p_free ();