Skip to content

Commit

Permalink
Correct Player.PlayPause behavior
Browse files Browse the repository at this point in the history
In current implementation using play parameter as boolean won't force the playerspeed to 1 as it should.
This PR correct this so that using a bool parameter act as the toggle and provide the same behavior as GUI or EventServer.
  • Loading branch information
Tolriq authored and Tolriq committed Feb 24, 2013
1 parent 5278fb7 commit adc54a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion xbmc/interfaces/json-rpc/PlayerOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,14 @@ JSONRPC_STATUS CPlayerOperations::PlayPause(const CStdString &method, ITransport
CBuiltins::Execute("playercontrol(play)");
else
{
if (parameterObject["play"].asBoolean() == g_application.IsPaused())
if (parameterObject["play"].asBoolean())
{
if (g_application.IsPaused())
CApplicationMessenger::Get().MediaPause();
else if (g_application.GetPlaySpeed() != 1)
g_application.SetPlaySpeed(1);
}
else if (!g_application.IsPaused())
CApplicationMessenger::Get().MediaPause();
}
result["speed"] = g_application.IsPaused() ? 0 : g_application.GetPlaySpeed();
Expand Down
2 changes: 1 addition & 1 deletion xbmc/interfaces/json-rpc/ServiceDescription.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
namespace JSONRPC
{
const char* const JSONRPC_SERVICE_ID = "http://www.xbmc.org/jsonrpc/ServiceDescription.json";
const char* const JSONRPC_SERVICE_VERSION = "6.0.1";
const char* const JSONRPC_SERVICE_VERSION = "6.0.2";
const char* const JSONRPC_SERVICE_DESCRIPTION = "JSON-RPC API of XBMC";

const char* const JSONRPC_SERVICE_TYPES[] = {
Expand Down

0 comments on commit adc54a9

Please sign in to comment.