From fd3282b02ddf35e5a33cd0df9c84135b7d98798a Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sat, 2 Mar 2013 15:46:51 +0000 Subject: [PATCH] Shutdown VDR Patch from Yaris --- vompclient.h | 6 +++--- vompclientrrproc.c | 19 +++++++++++++++++-- vompclientrrproc.h | 3 ++- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/vompclient.h b/vompclient.h index cab1599..4ec905e 100644 --- a/vompclient.h +++ b/vompclient.h @@ -78,9 +78,9 @@ class VompClient private: static int nr_clients; - void incClients(); - void decClients(); - + static void incClients(); + static void decClients(); + static ULLONG ntohll(ULLONG a); static ULLONG htonll(ULLONG a); diff --git a/vompclientrrproc.c b/vompclientrrproc.c index 5884721..4698eb3 100644 --- a/vompclientrrproc.c +++ b/vompclientrrproc.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "recplayer.h" #include "mvpreceiver.h" #endif @@ -42,7 +43,7 @@ bool ResumeIDLock; -ULONG VompClientRRProc::VOMP_PROTOCOL_VERSION = 0x00000200; +ULONG VompClientRRProc::VOMP_PROTOCOL_VERSION = 0x00000301; // format is aabbccdd // cc is release protocol version, increase with every release, that changes protocol // dd is development protocol version, set to zero at every release, @@ -258,7 +259,10 @@ bool VompClientRRProc::processPacket() case 23: result = processDeleteTimer(); break; -#endif + case 666: + result = processVDRShutdown(); + break; +#endif case VDR_GETMEDIALIST: result = processGetMediaList(); break; @@ -1938,6 +1942,17 @@ int VompClientRRProc::processGetMarks() return 1; } +int VompClientRRProc::processVDRShutdown() +{ + log->log("RRProc", Log::DEBUG, "Trying to shutdown VDR"); + VompClient::decClients(); // Temporarily make this client disappear + cRemote::Put(kPower); + VompClient::incClients(); + resp->finalise(); + x.tcp.sendPacket(resp->getPtr(), resp->getLen()); + return 1; +} + #endif // !VOMPSTANDALONE diff --git a/vompclientrrproc.h b/vompclientrrproc.h index 8e7bc7b..da6ef12 100644 --- a/vompclientrrproc.h +++ b/vompclientrrproc.h @@ -81,6 +81,7 @@ class VompClientRRProc : public Thread int processGetChannelPids(); int processDeleteTimer(); int processReScanRecording(); // FIXME obselete + int processVDRShutdown(); #endif int processLogin(); int processConfigSave(); @@ -93,7 +94,7 @@ class VompClientRRProc : public Thread int processGetLanguageList(); int processGetLanguageContent(); int processSetCharset(); - + void threadMethod(); VompClient& x; -- 2.39.2