Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Using QMediaPlayer to play a wav on Mac OS X Mountain Lion, makes the program exit unsucessfully
Forum Updated to NodeBB v4.3 + New Features

Using QMediaPlayer to play a wav on Mac OS X Mountain Lion, makes the program exit unsucessfully

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zarnick
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • P Offline
      P Offline
      pestO
      wrote on last edited by
      #2

      I create for this problem issue in "Qt bug tracker":https://bugreports.qt-project.org/browse/QTBUG-34213

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved