@@ -892,7 +892,7 @@ void Quick2ViewCmdExecutor::GetPlayerVolume(const ElementId &element, double *vo
892892 base::Value* volumeValue = NULL ;
893893 GetAttribute (element, " volume" , &volumeValue, error);
894894
895- if ( error != NULL && *error != NULL && (*error)-> code () != kSuccess ){
895+ if ( *error){
896896 return ;
897897 }
898898
@@ -932,7 +932,7 @@ void Quick2ViewCmdExecutor::GetPlayingPosition(const ElementId &element, double
932932 base::Value* positionValue = NULL ;
933933 GetAttribute (element, " position" , &positionValue, error);
934934
935- if ( error != NULL && *error != NULL && (*error)-> code () != kSuccess ){
935+ if ( *error){
936936 return ;
937937 }
938938
@@ -955,10 +955,13 @@ void Quick2ViewCmdExecutor::SetPlayingPosition(const ElementId &element, double
955955
956956 double currentPosition = 0 ;
957957 GetPlayingPosition (element, ¤tPosition, error);
958- if (error)
958+ if (* error)
959959 return ;
960+
960961 int positionOffset = (int )((position - currentPosition) * 1000 );
961- bool isMethodCalled = QMetaObject::invokeMethod (pItem," seek" , Q_ARG (int , positionOffset));
962+ QVariant var (positionOffset);
963+ bool isMethodCalled = QMetaObject::invokeMethod (pItem, " seek" ,
964+ Q_ARG (QVariant, var));
962965
963966 if (!isMethodCalled){
964967 (*error) = new Error (kUnknownError ,
@@ -999,7 +1002,7 @@ void Quick2ViewCmdExecutor::GetMute(const ElementId &element, bool *mute, Error
9991002 base::Value* muteValue = NULL ;
10001003 GetAttribute (element, " muted" , &muteValue, error);
10011004
1002- if ( error != NULL && *error != NULL && (*error)-> code () != kSuccess ){
1005+ if ( *error){
10031006 return ;
10041007 }
10051008
@@ -1039,7 +1042,7 @@ void Quick2ViewCmdExecutor::GetPlaybackSpeed(const ElementId &element, double *s
10391042 base::Value* positionValue = NULL ;
10401043 GetAttribute (element, " playbackRate" , &positionValue, error);
10411044
1042- if ( error != NULL && *error != NULL && (*error)-> code () != kSuccess ){
1045+ if ( *error){
10431046 return ;
10441047 }
10451048
0 commit comments