diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2012-05-26 15:50:18 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2012-05-26 17:46:43 +0200 |
commit | ed7b2597a439c27e60d0b4cec85e801c9099173c (patch) | |
tree | 72021f19cf618cf78036cccf7c1d91e280360282 /src/main.c | |
parent | 2c5bcc5ee10d6e982daa6660ba1925b3d95a2922 (diff) | |
download | pianobar-ed7b2597a439c27e60d0b4cec85e801c9099173c.tar.gz pianobar-ed7b2597a439c27e60d0b4cec85e801c9099173c.tar.bz2 pianobar-ed7b2597a439c27e60d0b4cec85e801c9099173c.zip |
Move mutex initalization to main thread
Closes #250.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,5 +1,5 @@ /* -Copyright (c) 2008-2011 +Copyright (c) 2008-2012 Lars-Dominik Braun <lars@6xq.net> Permission is hereby granted, free of charge, to any person obtaining a copy @@ -206,6 +206,7 @@ static void BarMainStartPlayback (BarApp_t *app, pthread_t *playerThread) { app->player.scale = BarPlayerCalcScale (app->player.gain + app->settings.volume); app->player.audioFormat = app->playlist->audioFormat; app->player.settings = &app->settings; + pthread_mutex_init (&app->player.pauseMutex, NULL); /* throw event */ BarUiStartEventCmd (&app->settings, "songstart", @@ -233,6 +234,7 @@ static void BarMainPlayerCleanup (BarApp_t *app, pthread_t *playerThread) { /* FIXME: pthread_join blocks everything if network connection * is hung up e.g. */ pthread_join (*playerThread, &threadRet); + pthread_mutex_destroy (&app->player.pauseMutex); /* don't continue playback if thread reports error */ if (threadRet != (void *) PLAYER_RET_OK) { |