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

NULL pointer crash in MFPlayerSession::handleMediaSourceReady()

    XMLWordPrintable

Details

    • b3d88c66be2ba6a6975cd3dd152a40fe429ecb6c

    Description

      Crash happen very rarely when repeatedly play and stop m4a sound file using QMediaPlayer.

      Seems that mediaSource variable is null.
      Stack trace attached.

       
      void MFPlayerSession::handleMediaSourceReady()
      {
          if (QMediaPlayer::LoadingMedia != m_status || !m_sourceResolver)
              return;
      #ifdef DEBUG_MEDIAFOUNDATION
          qDebug() << "handleMediaSourceReady";
      #endif
          HRESULT hr = S_OK;
          IMFPresentationDescriptor* sourcePD;
          IMFMediaSource* mediaSource = m_sourceResolver->mediaSource();
          hr = mediaSource->CreatePresentationDescriptor(&sourcePD);
          if (SUCCEEDED(hr)) {
              m_duration = 0;
              m_playerService->metaDataControl()->updateSource(sourcePD, mediaSource);
              sourcePD->GetUINT64(MF_PD_DURATION, &m_duration);
              //convert from 100 nanosecond to milisecond
              emit durationUpdate(qint64(m_duration / 10000));
              setupPlaybackTopology(mediaSource, sourcePD);
          } else {
              changeStatus(QMediaPlayer::InvalidMedia);
              emit error(QMediaPlayer::ResourceError, tr("Cannot create presentation descriptor."), true);
          }
      }
      

      Attachments

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

        Activity

          People

            davschul David Schulz
            anylitok Antti Yli-Tokola (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes