Skip to content

Fixed pause button not working#626

Open
sofian wants to merge 1 commit into
devfrom
bugfix-video-pause
Open

Fixed pause button not working#626
sofian wants to merge 1 commit into
devfrom
bugfix-video-pause

Conversation

@sofian

@sofian sofian commented Jul 26, 2026

Copy link
Copy Markdown
Member

Summary

VideoImpl::setPlayState() wasn't declared virtual. VideoPlayerImpl declares its own setPlayState() that does the real work (_player->pause()/_player->play()), but since the base wasn't virtual it was just a separate function hiding the base one — never reachable through the VideoImpl* pointer that Video::_doPause()/_doPlay() actually call through. So pausing silently no-opped (just set a bookkeeping flag), while play appeared to work because VideoPlayerImpl::loadMovie() calls _player->play() directly on load, independent of this path.

Fix: made VideoImpl::setPlayState() virtual and added override on VideoPlayerImpl's.

Test plan

  • qmake6 mapmap.pro && make builds clean
  • tests/ suite builds and all 44 existing Qt Test cases pass
  • Standalone dispatch test: calling setPlayState() through a VideoImpl* base pointer on a VideoPlayerImpl with no movie loaded returns true (dispatched to the base no-op) before the fix, and false (dispatched to the real derived implementation) after — confirmed both ways

@sofian
sofian requested a review from aalex July 27, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants