-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.7.2
-
None
-
Edition Windows 10 Education
Version 22H2
Installed on 26/10/2020
OS build 19045.4651
Experience Windows Feature Experience Pack 1000.19060.1000.0
Qt from vcpkg
Shared Qt, shared FFmpeg.
-
-
ddf0c17aa (dev), 3dbe26f5c (6.8), ee52d13c3 (6.7), 9287fcf1a (tqtc/lts-6.5)
-
Multimedia wk 35-38
I have a MediaPlayer in QML that I use to play sound files for items in my menu. The code is at the bottom of this description.
When I swipe in the menu, the source of the player changes to the sound file of the current item. Sometimes, the item does not have a sound - then I assign "" to source. It is possible for the sound file not to exist on the disk.
When I switched to the FFmpeg backend on Windows for ogg support, I started getting assertion errors when scrolling through my menu. The assert that triggers is in setMediaAsync of QFFmpegMediaPlayer, at the first line:
Q_ASSERT(mediaStatus() == QMediaPlayer::LoadingMedia);
The value of mediaStatus() is QMediaPlayer::NoMedia.
The value of cancelToken, checked in the next line of code, is true. So the function exits immediately after this assert anyway, causing no apparent issues on a release build.
It seems probable to me that the media status changed between setMedia }}and {{setMediaAsync and the assert fails to handle that properly.
My QML code:
MediaPlayer {
id: playMusic
property bool waitingForStop: false
loops: MediaPlayer.Infinite
source: {
let base = songList.current instanceof ChartData ? PreviewFilePathFetcher.getPreviewFilePath(songList.current.chartDirectory) : ""
if (base === "") {
return base;
}
if (base[0] !== '/') {
base = '/' + base;
}
return "file://" + base;
}
audioOutput: AudioOutput {
id: audioOutput
}
onSourceChanged: {
playMusic.stop();
previewDelayTimer.stop();
waitingForStop = playMusic.source !== "";
}
}
Connections {
function onMovingChanged() {
if (playMusic.waitingForStop) {
previewDelayTimer.restart();
}
}
target: songList
}
Timer {
id: previewDelayTimer
interval: 300
onTriggered: {
playMusic.play();
}
}
- duplicates
-
QTBUG-126780 QMediaPlayer error when stop loading media?
-
- Closed
-
| For Gerrit Dashboard: QTBUG-128159 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 588782,5 | Fix Q_ASSERT crash in QFFmpegMediaPlayer::setMediaAsync() | dev | qt/qtmultimedia | Status: MERGED | +2 | 0 |
| 591341,2 | Fix Q_ASSERT crash in QFFmpegMediaPlayer::setMediaAsync() | 6.8 | qt/qtmultimedia | Status: MERGED | +2 | 0 |
| 591425,2 | Fix Q_ASSERT crash in QFFmpegMediaPlayer::setMediaAsync() | 6.7 | qt/qtmultimedia | Status: MERGED | +2 | 0 |
| 591549,5 | Fix Q_ASSERT crash in QFFmpegMediaPlayer::setMediaAsync() | tqtc/lts-6.5 | qt/tqtc-qtmultimedia | Status: MERGED | +2 | 0 |