Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various issue regarding window size in music mode #2771

Merged
merged 2 commits into from Feb 16, 2020

Conversation

lhc70000
Copy link
Member

@lhc70000 lhc70000 commented Feb 15, 2020

Description:

Currently, if there's no video track, mpv won't send the video reconfig event and thus windows won't change their sizes accordingly. Info such as aspect ratio and video size will remain to be the last video track. I'm not sure whether it worked well before and it's an internal change in mpv. Now the player remains functional due to an awkward fallback mechanism, and here are some obvious glitches:

  • Disable auto music mode switching and open an audio file without album art. The window aspect ratio will be the initial one (16:10) at first, but suddenly jump to 1:1 on resize. This also happens when switching back from music mode.
  • Open a landscape or portrait video, switch to music mode, and open another audio without album art. The album art part of the mini player will have a wrong aspect ratio.

In this PR, notifyMainWindowVideoSizeChanged is also called on playback restart if there's no video track to make sure windows receive the resize event. player.originalVideoSize is used to check if there's no video in the mini player. The default window size has been changed to 640x400.

Before merging, extensive tests are required to ensure it didn't break anything.

iina/MiniPlayerWindowController.swift Outdated Show resolved Hide resolved
iina/PlayerCore.swift Outdated Show resolved Hide resolved
iina/PlayerCore.swift Outdated Show resolved Hide resolved
@uiryuu uiryuu merged commit 2ecd779 into develop Feb 16, 2020
@lhc70000 lhc70000 deleted the music-mode-window-size branch February 16, 2020 16:18
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.

None yet

2 participants