Skip to content

Commit

Permalink
fix media player seek/position handling
Browse files Browse the repository at this point in the history
It remove the multiplication by 1000 when calling media player seek.

It change to send update position callback even if the media is paused.

Signed-off-by: kimhyungrok <hr97gdi@gmail.com>
  • Loading branch information
kimhyungrok committed Jun 12, 2024
1 parent 9d2dce0 commit b86aaeb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/media_player.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ MediaPlayer::MediaPlayer(int volume)
d->pos_timer = new NUGUTimer();
d->pos_timer->setInterval(POSITION_POLLING_TIMEOUT_500MS);
d->pos_timer->setCallback([&]() {
if (!isPlaying())
if (!isActive())
return;

updatePosition();
Expand Down Expand Up @@ -495,4 +495,9 @@ NuguPlayer* MediaPlayer::getNuguPlayer()
return d->player;
}

bool MediaPlayer::isActive()
{
return isPlaying() || d->state == MediaPlayerState::PAUSED;
}

} // NuguCore
1 change: 1 addition & 0 deletions src/core/media_player.hh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public:

private:
void setPositionWithSeek(int position);
bool isActive();

MediaPlayerPrivate* d;
};
Expand Down

0 comments on commit b86aaeb

Please sign in to comment.