[PATCH] zapit: make setStandby(false) block

this avoids many nasty race conditions when leaving standby

From: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: Sat, 25 Feb 2012 22:34:58 +0100

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2131 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Branch: ni/coolstream
Commit: ac3707eccb
Author: gixxpunk <thomas.harfmann@gmail.com>
Date: 2012-02-27 (Mon, 27 Feb 2012)



------------------
This commit was generated by Migit
This commit is contained in:
gixxpunk
2012-02-27 18:56:12 +00:00
parent 7a37cbefe8
commit f9f535e208
2 changed files with 4 additions and 6 deletions

View File

@@ -921,10 +921,8 @@ void CZapitClient::setStandby(const bool enable)
CZapitMessages::commandBoolean msg;
msg.truefalse = enable;
send(CZapitMessages::CMD_SET_STANDBY, (char*)&msg, sizeof(msg));
if(enable) {
CZapitMessages::responseCmd response;
CBasicClient::receive_data((char* )&response, sizeof(response));
}
CZapitMessages::responseCmd response;
CBasicClient::receive_data((char* )&response, sizeof(response));
close_connection();
}

View File

@@ -1520,10 +1520,10 @@ printf("[zapit] TP_id %d freq %d rate %d fec %d pol %d\n", TP.TP_id, TP.feparams
if (msgBoolean.truefalse) {
// if(currentMode & RECORD_MODE) videoDecoder->freeze();
enterStandby();
response.cmd = CZapitMessages::CMD_READY;
CBasicServer::send_data(connfd, &response, sizeof(response));
} else
leaveStandby();
response.cmd = CZapitMessages::CMD_READY;
CBasicServer::send_data(connfd, &response, sizeof(response));
break;
}