mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-25 06:56:15 +02:00
clean
git-svn-id: svn://elaine/murooma/trunk@318 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
83eed0be78
commit
bccffc7432
4 changed files with 37 additions and 11 deletions
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "common/utils.h"
|
||||
#include "common/log.h"
|
||||
#include "common/signalHandler.h"
|
||||
#include "controller.h"
|
||||
#include "alsaPlayer.h"
|
||||
|
||||
|
@ -18,6 +19,8 @@
|
|||
using namespace std;
|
||||
namespace po = boost::program_options;
|
||||
|
||||
//bool g_terminated = false;
|
||||
std::condition_variable terminateSignaled;
|
||||
|
||||
PcmDevice getPcmDevice(const std::string& soundcard)
|
||||
{
|
||||
|
@ -87,6 +90,10 @@ int main (int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
signal(SIGHUP, signal_handler);
|
||||
signal(SIGTERM, signal_handler);
|
||||
signal(SIGINT, signal_handler);
|
||||
|
||||
std::clog.rdbuf(new Log("snapclient", LOG_DAEMON));
|
||||
if (runAsDaemon)
|
||||
{
|
||||
|
@ -105,8 +112,11 @@ int main (int argc, char *argv[])
|
|||
Controller controller;
|
||||
controller.start(pcmDevice, ip, port, latency);
|
||||
|
||||
while(true)
|
||||
usleep(10000);
|
||||
|
||||
std::mutex mtx;
|
||||
std::unique_lock<std::mutex> lck(mtx);
|
||||
terminateSignaled.wait(lck);
|
||||
controller.stop();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue