Uploaded image for project: 'Qt Mobility'
  1. Qt Mobility
  2. QTMOBILITY-149

QMediaPlayer::setPosition() doesn't always work properly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • 1.0.2
    • 1.0.0
    • Multimedia
    • None
    • Qt 4.6.2, SuSE Linux 11.2 32 bit

    Description

      In some cases QMediaPlayer::setPosition() doesn't work. Debugging QMediaPlayer class shows that QGstreamerPlayerSession::seek calls the following code:

      if (m_playbin && m_state != QMediaPlayer::StoppedState) {
      ...
      }

      So the m_state variable has QMediaPlayer::StoppedState value, but calling QMediaPlayer::state() shows that QMediaPlayer is in QMediaPlayer::PlayingState. I think this is because QMediaPlayer::state() returns

      d_func()->state

      when both d_func()->state and m_state are not synchronized.

      I have attached an example source code that shows the problem. So build it and do the following:

      1. Press Open button to load a video
      2. Press Play button start playing it. As you see in Player::handleStateChange() I added a code that sets the video file to playback from the middle of it. So pass it on this state cause because isSeekable() returns false and QMediaPlayer::setPosition() doesn't work
      3. Press Stop button
      4. Press Play again. Now in Player::handleStateChange() the code doesn't work because the internal state in QGstreamerPlayerSession is different from QMediaPlayer::state()

      The video file that I tried can be found at:

      http://www.polycrystal.org/lego/movies/A_New_Computer--small.ogg

      Attachments

        Activity

          People

            poplavsk Dmytro Poplavskiy (Inactive)
            barberis Victor
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: