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

QMediaPlayer hangs up on setPosition(...) when using gstreamer backend

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 5.15.8, 6.4.3
    • Multimedia
    • Arch Linux with wayland and package qt6-multimedia-gstreamer providing qt6-multimedia-backend

    Description

      Consider a QMediaPlayer object playing a video shown in a QVideoWidget.
      After the playback stops because video has reached its end, the QMediaPlayer may have position()==duration()-320, mediaStatus()==BufferedMedia, and playbackState==PlayingState. The user may now set the playback position: player->setPosition(...);. This (often) leads to the main thread hanging up.

      Use case: A user may have a slider or other tools to control the playback position. Typically the maximum value for the slider is duration().

      Steps to reproduce: Make sure you use the gstreamer backend. The attached program takes as a command line argument the path to a video file. Choose a short video file (a few seconds is enough) and run the program. You should see the video playing. You can use the arrow keys (right/left) to move forward/backward by 1s. After the video has reached its end, try to navigate backward/forward. In some cases this will work, in others the program will hang up.

       

      BTW: There are a few more bugs, which are less severe. For example, the QMediaPlayer::loops property has no effect. More difficult to reproduce: With the gstreamer backend the audio sometimes vanishes randomly. For users of Arch Linux I highly recommend using the ffmpeg backend instead of gstreamer (except if you want to show live streams).

      UPDATE: Qt 5.15.8 is also affected. To test this, you can use the updated version of the attached program, which can be configured to use Qt 5 with cmake -DQT_VERSION_MAJOR=5.

      Attachments

        Issue Links

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

          Activity

            People

              timblechmann tim blechmann
              valentinb Valentin B
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes