Using QMediaPlayer to play a wav on Mac OS X Mountain Lion, makes the program exit unsucessfully
-
Hello, I'm trying to build an application (QT 5.0.2) that somewhere in it, it plays a sound, pretty much like a sound effect. For that I'm using QMediaPlayer (since I don't know why, but QSoundEffect didn't played the WAV file), and although it plays the sound, when I quit the program it actually crashes.
Now, this happens only on Mac OS X, if I take it to a Windows 7 machine, compile it, it goes smoothly.
Here's how I'm actually using it:This is the constructor:
@
_player = new QMediaPlayer(this);
_player->setMedia(QUrl::fromLocalFile(hornSound));@And this is where I need it
@
_player->play();
@And this is the destructor:
@
delete _player;
@
And this is the stack of the program when it crashes:
@
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x00007fff8ea2d256 objc_msgSend + 22
1 com.apple.avfoundation 0x00007fff88e2d933 -[AVPlayer willChangeValueForKey:] + 55
2 com.apple.avfoundation 0x00007fff88e3df22 -[AVPlayer setRate:] + 63
3 libqavfmediaplayer.dylib 0x00000001015b92da -[AVFMediaPlayerSessionObserver unloadMedia] + 42
4 libqavfmediaplayer.dylib 0x00000001015ba681 -[AVFMediaPlayerSessionObserver dealloc] + 145
5 libqavfmediaplayer.dylib 0x00000001015ba91d AVFMediaPlayerSession::~AVFMediaPlayerSession() + 61
6 libqavfmediaplayer.dylib 0x00000001015ba8a2 AVFMediaPlayerSession::~AVFMediaPlayerSession() + 18
7 libqavfmediaplayer.dylib 0x00000001015b8526 AVFMediaPlayerService::~AVFMediaPlayerService() + 38
8 QtMultimedia 0x000000010014aeb4 QMediaPlayer::~QMediaPlayer() + 68
9 com.yourcompany.InlineSpeedTracker 0x0000000100017321 RaceTimer::~RaceTimer() + 65
10 com.yourcompany.InlineSpeedTracker 0x000000010001726f RaceTimer::~RaceTimer() + 15
11 QtCore 0x0000000100868dfe QObjectPrivate::deleteChildren() + 110
12 QtWidgets 0x0000000100d98d5d QWidget::~QWidget() + 1389
13 com.yourcompany.InlineSpeedTracker 0x0000000100013212 StartRace::~StartRace() + 162
14 com.yourcompany.InlineSpeedTracker 0x00000001000130ff StartRace::~StartRace() + 15
15 QtCore 0x0000000100868dfe QObjectPrivate::deleteChildren() + 110
16 QtWidgets 0x0000000100d98d5d QWidget::~QWidget() + 1389
17 com.yourcompany.InlineSpeedTracker 0x0000000100005fb8 main + 72
18 com.yourcompany.InlineSpeedTracker 0x0000000100005f64 start + 52
@
And yes, this happens even if I remove the destructor, if I use it as a static object, and on the QT 5.1.0.Thanks for the help.
-
I create for this problem issue in "Qt bug tracker":https://bugreports.qt-project.org/browse/QTBUG-34213