Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Sample player improvements #14

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

samhocevar
Copy link
Contributor

Hi! I tried to make the sample player more useful (can play a file from command line), use less memory, and the code is also a bit safer. If any of these changes doesn’t suit you, I’m happy to fix or submit another PR restricted to what you’d like to keep.

Thanks for providing this library, by the way. It is quite straightforward and does the job very nicely.

If the decoder was fast enough, it would accumulate up to 1024 1280×720 frames in
the framebuffer channel, amounting to more than 3.6 GiB of memory. It seems more
reasonable to store about 10 images in the queue.

Similarly, decrease the audio buffer queue down to 8192 samples, which is about
11 frames of a 30fps video.
@zergon321
Copy link
Owner

I'm afraid I can't accept this PR at its current state because the video resolution doesn't correspond to the window resolution (tested on Linux). Couldn't manage to figure out why, sorry.
image

@samhocevar
Copy link
Contributor Author

I really scratched my head around this and it’s really puzzling. The code calls ebiten.SetWindowSize() with the width and height of the video. However the video is 1280×720 yet your screenshot size is 1636×969, how is that possible? Is your monitor highDPI maybe? Could you please try to print the value of ebiten.DeviceScaleFactor() when running the program?

@zergon321
Copy link
Owner

Yes, I think my screen is HiDPI. I hava a Lenovo Legion 5 15ACH6H laptop, the size is 15.6", the definition is Full HD (1920x1080). I use KDE Plasma with 125% scale.

image

But when I call ebiten.DeviceScaleFactor() in either Start() (at the end before the return statement) or Update() (at the end of the case <-game.perSecond instruction block), it always returns 1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants