| 416 | } |
| 417 | |
| 418 | void VideoHandler::UpdateExclusive() |
| 419 | { |
| 420 | if (_deInitializing || _player == nullptr) |
| 421 | return; |
| 422 | |
| 423 | bool interruptPlayback = false; |
| 424 | |
| 425 | if (_updateInput) |
| 426 | { |
| 427 | App.ResetClock = true; |
| 428 | UpdateInputActions(true); |
| 429 | interruptPlayback = IsHeld(In::Deselect) || IsHeld(In::Look); |
| 430 | _updateInput = _starting = false; |
| 431 | } |
| 432 | |
| 433 | auto state = libvlc_media_player_get_state(_player); |
| 434 | |
| 435 | // If player is just opening, buffering, or stopping, always return early and wait for process to end. |
| 436 | if (state == libvlc_Opening || state == libvlc_Buffering) |
| 437 | return; |
| 438 | |
| 439 | // Reset playback to start if video is looped. |
| 440 | if (_looped && !interruptPlayback && (state == libvlc_Stopping || state == libvlc_Stopped)) |
| 441 | libvlc_media_player_play(_player); |
| 442 | |
| 443 | // If user pressed a key to break out from video or video has finished playback or in an error, stop and delete it. |
| 444 | if (interruptPlayback || state == libvlc_Error || (!_starting && state == libvlc_Stopped)) |
| 445 | { |
| 446 | Stop(); |
| 447 | ClearAction(In::Pause); // HACK: Otherwise pause key won't work after video ends. |
| 448 | ResumeAllSounds(SoundPauseMode::Pause); |
| 449 | } |
| 450 | |
| 451 | HandleError(); |
| 452 | } |
| 453 | |
| 454 | void VideoHandler::RenderExclusive() |
| 455 | { |
nothing calls this directly
no test coverage detected