mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 01:00:18 +02:00
Play without the theatre surround if SteamVR refuses it
Review (SWE-2 Max): a non-standby error creating the cosmetic surround at startup still ended playback before the screen appeared. Theatre now logs it and plays without the surround. close() treats any per-overlay teardown error as best effort (signals are already ignored there). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
0e8b699fcd
commit
dac9dbce6e
2 files changed
+16
-5
No files matched your search
@@ -135,6 +135,13 @@ class Media(unittest.TestCase):
|
||||
self.assertEqual(result['dropped'], 2)
|
||||
self.assertIn((0, 1, 1), calls[3:])
|
||||
|
||||
def test_theatre_surround_failure_does_not_stop_playback(self):
|
||||
def fail_surround(n):
|
||||
if n == 1: # the surround's upload is the first pixels call
|
||||
raise RuntimeError('OpenVR SetOverlayRaw failed: 11')
|
||||
result, _ = self.play_with('clip_SBS.mp4', on_pixels=fail_surround)
|
||||
self.assertEqual((result['state'], result['frames']), ('ended', 4))
|
||||
|
||||
def test_stop_mid_video_reports_stopped(self):
|
||||
result, _ = self.play_with('clip_SBS.mp4', on_pixels=lambda n: n == 3 and stop_now())
|
||||
self.assertEqual(result['state'], 'stopped')
|
||||
|
||||
@@ -92,7 +92,7 @@ class Overlay:
|
||||
for h in reversed(self.handles):
|
||||
try:
|
||||
self.call('DestroyOverlay', h)
|
||||
except RuntimeError:
|
||||
except Exception: # signals are already ignored here, so Stop isn't lost
|
||||
pass
|
||||
finally:
|
||||
self.vr.VR_ShutdownInternal()
|
||||
@@ -207,10 +207,14 @@ def play(args):
|
||||
try:
|
||||
vr = Overlay()
|
||||
if args.theatre:
|
||||
surround = vr.create('framecontrol.media.surround', 40, 4, order=0)
|
||||
vr.call('SetOverlayAlpha', surround, .85)
|
||||
if not show(surround, b'\x00\x00\x00\xff', 1, 1):
|
||||
pending.append((surround, b'\x00\x00\x00\xff', 1, 1))
|
||||
try:
|
||||
surround = vr.create('framecontrol.media.surround', 40, 4, order=0)
|
||||
vr.call('SetOverlayAlpha', surround, .85)
|
||||
if not show(surround, b'\x00\x00\x00\xff', 1, 1):
|
||||
pending.append((surround, b'\x00\x00\x00\xff', 1, 1))
|
||||
except RuntimeError as e:
|
||||
# Cosmetic: play without the dark surround rather than not at all.
|
||||
print('Theatre surround unavailable: %s' % e, flush=True)
|
||||
screen = vr.create('framecontrol.media.screen', 3 if args.theatre else 1.6, 2,
|
||||
plan['layout'] != 'mono', aspect)
|
||||
if splat:
|
||||
|
||||
Reference in new issue
Block a user