Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QMediaPlayer::setPosition(qint64 pos) not work in Mac
Qt 6.11 is out! See what's new in the release blog

QMediaPlayer::setPosition(qint64 pos) not work in Mac

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 873 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • joeQJ Offline
    joeQJ Offline
    joeQ
    wrote on last edited by joeQ
    #1

    Just to use QMediaPlayer::setPosition to set video current position, like below snippet:

    I test the below code in Windows, it can get the correct position after set.

    qDebug() << "SetPos:" << newpos;
    
    _player->setPosition(newpos);
    
    qDebug() << "Get Pos Right now:" << _player->position();  ///< putout wrong position, it not equal newpos
    

    But, In Mac, I get wrong position after set.

    sometime, i get the position < set position.
    sometime, i get the position > set position.

    How to get the correct position after set ?

    I also found the one who had same problem with me, but no answer.

    and another topic same problem
    and stackoverflow

    Just do it!

    1 Reply Last reply
    0
    • joeQJ Offline
      joeQJ Offline
      joeQ
      wrote on last edited by
      #2

      About my problem, I analysis some different what my progream in windows and mac os.

      1. the format of video is different. the video format is avi in windows and mp4 in mac. as we all know, different format will need different video decoder.
      2. setPosition may be is asynchronous. the value of my set may not be take effict immediately. so, if i get the position right now, it will return similar to the value. after you set value, it need to used video devoder to working, maybe it will spend some time. and the time is different from different video format and different video decoder;

      I test some setPosition and get the position right now. all the 1000 record data different [-130ms,130ms]. this range is acceptable for me.

      Just do it!

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved