GUI: Qt6: actively check if QMediaPlayer is available instead of version check

This commit is contained in:
Moritz Bunkus 2022-02-21 22:35:56 +01:00
parent b489d894fe
commit f73d30ac51
No known key found for this signature in database
GPG Key ID: 74AF00ADF2E32C85
3 changed files with 11 additions and 3 deletions

View File

@ -229,6 +229,7 @@ EOF
AC_MSG_CHECKING(for Qt 5)
if test x"$problem" = x; then
AC_DEFINE(HAVE_QMEDIAPLAYER, 1, [Define to 1 if you have the QMediaPlayer header file.])
AC_DEFINE(HAVE_QT, 1, [Define if Qt is present])
AC_MSG_RESULT(yes)
have_qt5=yes

View File

@ -202,6 +202,13 @@ return 0;
return
fi
AC_LANG_PUSH(C++)
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$STD_CXX $CXXFLAGS $QT_CFLAGS -fPIC"
AC_CHECK_HEADERS([QMediaPlayer])
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_POP()
AC_DEFINE(HAVE_QT, 1, [Define if Qt is present])
AC_MSG_CHECKING(for Qt 6)
AC_MSG_RESULT(yes)

View File

@ -2,10 +2,10 @@
#include <Qt>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#if HAVE_QMEDIAPLYER
# include <QMediaPlayer>
#else // Qt < 6
#else // HAVE_QMEDIAPLAYER
# include <QUrl>
// Fake Media Player class as Qt 6.1 hasn't re-added the media framework yet.
@ -22,7 +22,7 @@ public:
void stop() {}
};
#endif // Qt < 6
#endif // HAVE_QMEDIAPLAYER
#include "mkvtoolnix-gui/util/media_player.h"