@@ -892,7 +892,7 @@ void Quick2ViewCmdExecutor::GetPlayerVolume(const ElementId &element, double *vo
892
892
base::Value* volumeValue = NULL ;
893
893
GetAttribute (element, " volume" , &volumeValue, error);
894
894
895
- if ( error != NULL && *error != NULL && (*error)-> code () != kSuccess ){
895
+ if ( *error){
896
896
return ;
897
897
}
898
898
@@ -932,7 +932,7 @@ void Quick2ViewCmdExecutor::GetPlayingPosition(const ElementId &element, double
932
932
base::Value* positionValue = NULL ;
933
933
GetAttribute (element, " position" , &positionValue, error);
934
934
935
- if ( error != NULL && *error != NULL && (*error)-> code () != kSuccess ){
935
+ if ( *error){
936
936
return ;
937
937
}
938
938
@@ -955,10 +955,13 @@ void Quick2ViewCmdExecutor::SetPlayingPosition(const ElementId &element, double
955
955
956
956
double currentPosition = 0 ;
957
957
GetPlayingPosition (element, ¤tPosition, error);
958
- if (error)
958
+ if (* error)
959
959
return ;
960
+
960
961
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));
962
965
963
966
if (!isMethodCalled){
964
967
(*error) = new Error (kUnknownError ,
@@ -999,7 +1002,7 @@ void Quick2ViewCmdExecutor::GetMute(const ElementId &element, bool *mute, Error
999
1002
base::Value* muteValue = NULL ;
1000
1003
GetAttribute (element, " muted" , &muteValue, error);
1001
1004
1002
- if ( error != NULL && *error != NULL && (*error)-> code () != kSuccess ){
1005
+ if ( *error){
1003
1006
return ;
1004
1007
}
1005
1008
@@ -1039,7 +1042,7 @@ void Quick2ViewCmdExecutor::GetPlaybackSpeed(const ElementId &element, double *s
1039
1042
base::Value* positionValue = NULL ;
1040
1043
GetAttribute (element, " playbackRate" , &positionValue, error);
1041
1044
1042
- if ( error != NULL && *error != NULL && (*error)-> code () != kSuccess ){
1045
+ if ( *error){
1043
1046
return ;
1044
1047
}
1045
1048
0 commit comments