add_definitions(-DBACKEND_MPV_LIBRARY)
+add_definitions(-DMPV_ENABLE_DEPRECATED=0)
+
install(TARGETS backend_mpv
LIBRARY DESTINATION ${INSTALL_DESTINATION}
ARCHIVE DESTINATION ${INSTALL_DESTINATION}
mpv_observe_property(m_handle, 0, "chapter-list", MPV_FORMAT_NODE);
qCDebug(mpvBackend) << "register chapter-list" << ret;
}
+ {
+ const auto ret =
+ mpv_observe_property(m_handle, 0, "idle-active", MPV_FORMAT_NODE);
+ qCDebug(mpvBackend) << "register chapter-list" << ret;
+ }
{
const auto ret = mpv_request_log_messages(m_handle, "info");
qCDebug(mpvBackend) << "request log messages" << ret;
map["time"].toDouble()};
}
m_player->backendChaptersChanged(chapters);
+ } else if (strcmp(property->name, "idle-active") == 0) {
+ m_player->playStateChanged(PlayerPluginInterface::PlayState::Stopped);
+ m_player->backendReadyToPlay();
} else {
qCWarning(mpvBackend)
<< "Change notification for not handled property" << property->name;
m_player->playbackEndOfFileReached();
}
} break;
- case MPV_EVENT_IDLE: {
- m_player->playStateChanged(PlayerPluginInterface::PlayState::Stopped);
- m_player->backendReadyToPlay();
- } break;
case MPV_EVENT_AUDIO_RECONFIG: {
if (m_volumeToSet >= 0) {
qCDebug(mpvBackend) << "Audio reconfigured, maybe it's ready now?";
#include <mpv/client.h>
-#if !MPV_ENABLE_DEPRECATED
-#error "This helper is deprecated. Copy it into your project instead."
-#else
-
/**
* Note: these helpers are provided for convenience for C++/Qt applications.
* This is based on the public API in client.h, and it does not encode any
Q_DECLARE_METATYPE(mpv::qt::ErrorReturn)
-#endif /* else #if MPV_ENABLE_DEPRECATED */
-
#endif