19
19
#include "menu_options.h"
20
20
#include "mpv_service.h"
21
21
22
- static const char * VERSION = "1.7.3 "
22
+ static const char * VERSION = "1.7.4 "
23
23
#ifdef GIT_REV
24
24
"-GIT" GIT_REV
25
25
#endif
@@ -76,7 +76,12 @@ void cMpvPlugin::PlayFile(string Filename, bool Shuffle)
76
76
cControl ::Launch (new cMpvControl (Filename .c_str (), Shuffle ));
77
77
else
78
78
{
79
+ #if APIVERSNUM < 20402
79
80
cMpvControl * control = dynamic_cast < cMpvControl * > (cControl ::Control (true));
81
+ #else
82
+ cMutexLock ControlMutexLock ;
83
+ cMpvControl * control = dynamic_cast < cMpvControl * > (cControl ::Control (ControlMutexLock , true));
84
+ #endif
80
85
if (control )
81
86
control -> PlayNew (Filename .c_str ());
82
87
}
@@ -109,11 +114,17 @@ cOsdObject *cMpvPlugin::MainMenuAction(void)
109
114
110
115
bool cMpvPlugin ::Service (const char * id , void * data )
111
116
{
117
+ #if APIVERSNUM >= 20402
118
+ cMutexLock ControlMutexLock ;
119
+ #endif
112
120
if (strcmp (id , "Mpv_Seek" ) == 0 )
113
121
{
114
122
Mpv_Seek * seekInfo = (Mpv_Seek * )data ;
115
-
123
+ #if APIVERSNUM < 20402
116
124
cMpvControl * control = dynamic_cast < cMpvControl * > (cControl ::Control (true));
125
+ #else
126
+ cMpvControl * control = dynamic_cast < cMpvControl * > (cControl ::Control (ControlMutexLock , true));
127
+ #endif
117
128
if (control )
118
129
{
119
130
if (seekInfo -> SeekRelative != 0 )
@@ -130,7 +141,11 @@ bool cMpvPlugin::Service(const char *id, void *data)
130
141
if (strcmp (id , "ScaleVideo" ) == 0 )
131
142
{
132
143
Mpv_ScaleVideo * scaleVideo = (Mpv_ScaleVideo * )data ;
144
+ #if APIVERSNUM < 20402
133
145
cMpvControl * control = dynamic_cast < cMpvControl * > (cControl ::Control (true));
146
+ #else
147
+ cMpvControl * control = dynamic_cast < cMpvControl * > (cControl ::Control (ControlMutexLock , true));
148
+ #endif
134
149
if (control )
135
150
{
136
151
control -> ScaleVideo (scaleVideo -> x , scaleVideo -> y , scaleVideo -> width , scaleVideo -> height );
@@ -140,7 +155,11 @@ bool cMpvPlugin::Service(const char *id, void *data)
140
155
if (strcmp (id , "GrabImage" ) == 0 )
141
156
{
142
157
Mpv_GrabImage * grabImage = (Mpv_GrabImage * )data ;
158
+ #if APIVERSNUM < 20402
143
159
cMpvControl * control = dynamic_cast < cMpvControl * > (cControl ::Control (true));
160
+ #else
161
+ cMpvControl * control = dynamic_cast < cMpvControl * > (cControl ::Control (ControlMutexLock , true));
162
+ #endif
144
163
if (control )
145
164
{
146
165
grabImage -> image = control -> GrabImage (& grabImage -> size , & grabImage -> width , & grabImage -> height );
0 commit comments