kutils: workaround issue wtih async access to the handle

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2016-04-21 13:56:20 +00:00
parent 751528cbe8
commit a0041f5d78
2 changed files with 5 additions and 4 deletions

View file

@ -219,9 +219,8 @@ void KAbstractPlayer::setFullscreen(bool fullscreen)
#define COMMON_DESTRUCTOR \
kDebug() << i18n("destroying player"); \
if (m_handle) { \
mpv_terminate_destroy(m_handle); \
} \
m_stopprocessing = true; \
mpv_terminate_destroy(m_handle); \
if (m_settings) { \
delete m_settings; \
}
@ -255,7 +254,7 @@ void KAbstractPlayer::setFullscreen(bool fullscreen)
}
#define COMMMON_EVENT_HANDLER \
while (m_handle) { \
while (!m_stopprocessing) { \
mpv_event *event = mpv_wait_event(m_handle, 0); \
if (event->event_id == MPV_EVENT_NONE) { \
break; \

View file

@ -270,6 +270,7 @@ private:
#endif // MAKE_KMEDIAPLAYER_LIB
QString m_appname;
QSettings *m_settings;
bool m_stopprocessing;
};
@ -336,6 +337,7 @@ private:
#endif // MAKE_KMEDIAPLAYER_LIB
QString m_appname;
QSettings *m_settings;
bool m_stopprocessing;
};
#endif // KMEDIAPLAYER_H