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

QMediaPlayer does not emit "error" signal for invalid file on mac (av foundation)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.1.0 Beta 1
    • 5.0.1
    • Multimedia
    • None
    • Mac OS X 10.7.5
      Qt: git://gitorious.org/qt/qt5.git (stable branch) d3d46ac7b315145cfce399450e5f99a2c16dd41b
    • macOS
    • e728a61eb68c44ef1746804cb379e46be64580e5

    Description

      When you try to load a bogus or unsupported media file there is no indication of this error. I believe the problem lies in the fact the av foundation impl (qtmultimedia/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm) does not emit this signal when it has an error. There is a TODO in there that I believe should emit the "error" signal.

      Code below would probably be sufficient.

      -(void) assetFailedToPrepareForPlayback:(NSError *)error
      {
      Q_UNUSED(error)
      //TODO: Let the session know that the assest failed to prepare for playback

      // Let the media player know that something went wrong
      Q_EMIT error(QMediaPlayer::FormatError, tr("Failed to load media"));

      #ifdef QT_DEBUG_AVF
      qDebug() << Q_FUNC_INFO;
      qDebug() << [[error localizedDescription] UTF8String];
      qDebug() << [[error localizedFailureReason] UTF8String];
      qDebug() << [[error localizedRecoverySuggestion] UTF8String];
      #endif
      }

      Attachments

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

        Activity

          People

            janichol Andy Nichols
            dantwinkler@gmail.com Dan Winkler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes