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

QMediaPlayer::setPosition doesn't jump to precisely position while playing an FLAC file

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • 6.2.5, 6.4.0 Beta1
    • 6.2.3, 6.3.0 Alpha, 6.3.0 Beta1, 6.3.0 Beta2, 6.4.0 FF
    • Multimedia
    • Windows 10 21H2, latest version of MSVC 2019 x64
    • Windows
    • b068cb3599 (qt/qtmultimedia/dev) 525e2f4c2c (qt/qtmultimedia/6.3) 0558f4c835 (qt/qtmultimedia/6.2) 0558f4c835 (qt/tqtc-qtmultimedia/6.2) 525e2f4c2c (qt/tqtc-qtmultimedia/6.3) b068cb3599 (qt/tqtc-qtmultimedia/dev) 525e2f4c2c (qt/qtmultimedia/6.3.0)

    Description

      After anrocha's patch for QTBUG-98191, the playhead jumping for FLAC files seems to work well. But it is far from perfect since the playing position jumping method QMediaPlayer::setPosition doesn't jump to the precise position.

      Still tested with official example "player" with a local FLAC audio file. When I dragged the slider to 0:30, 0:31, 0:32, 0:33, 0:34, 0:35, 0:36, 0:37 and 0:38, the playhead jumped to exactly the same position.

      It actually makes me remember key frame or I-Frame. When I enable "jump to key frame" in some video players and click the slider, playhead will only jump to the nearest I-Frame instead of the precise position marked by the slider bar. However, this is not expected in audio playing, and this problem never appears in Linux. Moreover, updated positions which are output through QMediaPlayer::durationChanged is also affected after the dragging. I also tested with Windows Media Player and did not observe this problem. Could you please fix it?

       


       

      2022-02-08 updated

      There is a method to avoid this problem: while playing a file, change the output device through QAudioOutput::setDevice by once or more than once. Then the problem will disappear within the playing time of that audio file.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-100181
          # Subject Branch Project Status CR V

          Activity

            People

              padubsky Pavel Dubsky
              zxfksie Xiang Zhang
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews