Multimedia accurate pause



  • Hi, I'm trying to make a subtitle editor with Qt using QtMultimedia,
    I want to be able to play one part, starting at a specific time and pausing at the specific time,
    I'm currently using positionChanged as following:
    @
    connect(player, SIGNAL(positionChanged(qint64)), SLOT(positionChanged(qint64)));
    void MyApp::positionChanged(qint64 time)
    {
    if(stopTime>0 && time>=stopTime && player->state()==QMediaPlayer::PlayingState)
    {
    stopTime = -1;
    player->pause();
    return;
    }
    }
    @
    but it is not accurate and playback pauses at some time after desired time,
    is there another way for that?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.