Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-34725

QMediaPlayer does not release file handle

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 5.1.1
    • Multimedia
    • None
    • Windows 7

    Description

      In the docs for QMediaPlayer::setMedia() it says:

      Setting this property to a null QMediaContent will cause the player to discard all information relating to the current media source and to cease all I/O operations related to that media.

      But doing so on Windows does not release the file handle on the last played audio file. On the contrary! I connected a slot to the mediaStatusChanged signal. I use this slot to start playback after status is QMediaPlayer::LoadedMedia.

      void AudioPlayer::playerStatus(QMediaPlayer::MediaStatus status)
      {
          //Do not start playing before media is loaded.
          if (status == QMediaPlayer::MediaStatus::LoadedMedia)
          {
              this->mediaPlayer->play();
          }
          if (status == QMediaPlayer::MediaStatus::EndOfMedia)
          {
              this->mediaPlayer->setMedia(QMediaContent());
          }
      }
      

      Using it like this is resulting in an "infinite loop" as the last loaded media (which should no longer be available to QMediaPlayer Object as I passed a null QMediaContent()) is played back over and over again.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ylopes Yoann Lopes
            crapp Christian Rapp
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes