mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Ignore messages which are not a reply to the request
Former-commit-id: 23aeecabb9dba84d8118ee83a16a964a8163a363
This commit is contained in:
parent
b1b6de7ce6
commit
f31ed069ef
@ -7,7 +7,7 @@ XBMCVideoChecker::XBMCVideoChecker(const std::string & address, uint16_t port, u
|
|||||||
QObject(),
|
QObject(),
|
||||||
_address(QString::fromStdString(address)),
|
_address(QString::fromStdString(address)),
|
||||||
_port(port),
|
_port(port),
|
||||||
_request("{\"jsonrpc\":\"2.0\",\"method\":\"Player.GetActivePlayers\",\"id\":1}"),
|
_request("{\"jsonrpc\":\"2.0\",\"method\":\"Player.GetActivePlayers\",\"id\":666}"),
|
||||||
_timer(),
|
_timer(),
|
||||||
_socket(),
|
_socket(),
|
||||||
_grabVideo(grabVideo),
|
_grabVideo(grabVideo),
|
||||||
@ -54,6 +54,15 @@ void XBMCVideoChecker::receiveReply()
|
|||||||
// expect that the reply is received as a single message. Probably oke considering the size of the expected reply
|
// expect that the reply is received as a single message. Probably oke considering the size of the expected reply
|
||||||
QString reply(_socket.readAll());
|
QString reply(_socket.readAll());
|
||||||
|
|
||||||
|
std::cout << reply.toStdString() << std::endl;
|
||||||
|
|
||||||
|
// check if the resply is a reply to one of my requests
|
||||||
|
if (!reply.contains("\"id\":666"))
|
||||||
|
{
|
||||||
|
// probably not. Leave this mreply as is and don't act on it
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
GrabbingMode newMode = GRABBINGMODE_INVALID;
|
GrabbingMode newMode = GRABBINGMODE_INVALID;
|
||||||
if (reply.contains("video"))
|
if (reply.contains("video"))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user