attract icon indicating copy to clipboard operation
attract copied to clipboard

Vid.NoAutostart flag not checked when returnig from game

Open oomek opened this issue 6 years ago • 3 comments

I would like to propose changes to how video_flags and video_playing properties behave during launching an emulator.

Currently when a snap has set Vid.NoAutoStart it does not have any effect on video state when returning from a game. The only way to have video not playing is to set snap.video_playing = false in Transition.FromGame

Additionally there is a stalled frame showing for 5 frames when video is restarted after returning from an emulator and persistent stalled frame when video is stopped in Transition.FromGame This is very noticeable when an emulator does not force resolution change and looks particularly bad on videos that have fade-ins.

So, to get rid of that stalled frame I suggest to call preload() on all videos to fill the texture buffer with the first frame in post_run()

Regarding the video state on exiting an emulator I'm not yet sure what should determine its state: Vid.NoAutostart flag, or previously called video_playing = false before launching an emulator

Please tell me what you think. I have a test branch and an example layout if you would like to discuss it further.

oomek avatar Nov 26 '19 12:11 oomek

I’ll get back on the other points, but I think the 5 frame stall may be caused by this:

https://github.com/mickelson/attract/blob/9b89765ff40ccd3217e4756b5abb2222c1381b75/src/fe_image.cpp#L203

try changing play_count to a lower number and see if that helps...

mickelson avatar Nov 27 '19 02:11 mickelson

Yes, that's exactly what is causing it.

oomek avatar Nov 27 '19 02:11 oomek

I've tried, the only thing that works is what I did here: https://github.com/oomek/attract/commits/fix-video-play-state

It fixes both, things NoAutostart check after exiting from an emulator and stalled buffer

oomek avatar Nov 27 '19 18:11 oomek