diff --git a/NEWS.md b/NEWS.md index 26f921c62..bd212b28b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -86,6 +86,8 @@ saying only that prefixes "are suitable sequences" for use with the variants. What is now verified, though, is that no variant is used multiple times within the same language tag. Part of the implementation/fix of #3307. +* build system & MKVToolNix GUI: fixed detecting the presence of & the + compilation with the multimedia module of Qt version 6.2.0 and newer. ## Build system changes diff --git a/ac/qt6.m4 b/ac/qt6.m4 index d6ae4f407..60c4e31cb 100644 --- a/ac/qt6.m4 +++ b/ac/qt6.m4 @@ -90,7 +90,7 @@ EOT "$QMAKE6" -makefile -nocache configure.pro > /dev/null result2=$? - if test -z $qmake_qt_ui_try; then + if test $result2 = 0 -o -z $qmake_qt_ui_try; then break fi diff --git a/src/mkvtoolnix-gui/util/media_player.cpp b/src/mkvtoolnix-gui/util/media_player.cpp index 0e073d58b..4d710b989 100644 --- a/src/mkvtoolnix-gui/util/media_player.cpp +++ b/src/mkvtoolnix-gui/util/media_player.cpp @@ -3,6 +3,9 @@ #include #if HAVE_QMEDIAPLAYER +# if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) +# include +# endif # include #else // HAVE_QMEDIAPLAYER @@ -34,10 +37,17 @@ class MediaPlayerPrivate { public: std::unique_ptr player; +#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) + std::unique_ptr audioOutput; +#endif explicit MediaPlayerPrivate() : player{new QMediaPlayer} { +#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) + audioOutput.reset(new QAudioOutput); + player->setAudioOutput(audioOutput.get()); +#endif } }; @@ -53,7 +63,11 @@ MediaPlayer::~MediaPlayer() { bool MediaPlayer::isPlaying() const { +#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) + return p_func()->player->playbackState() == QMediaPlayer::PlayingState; +#else return p_func()->player->state() == QMediaPlayer::PlayingState; +#endif } void @@ -63,8 +77,13 @@ MediaPlayer::playFile(QString const &fileName, stopPlayback(); +#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) + p->audioOutput->setVolume(volume); + p->player->setSource(QUrl::fromLocalFile(fileName)); +#else p->player->setVolume(volume); p->player->setMedia(QUrl::fromLocalFile(fileName)); +#endif p->player->play(); } @@ -73,7 +92,11 @@ MediaPlayer::stopPlayback() { auto p = p_func(); p->player->stop(); +#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) + p->player->setSource({}); +#else p->player->setMedia({}); +#endif } }