somewhat stable

This commit is contained in:
2026-04-10 11:47:15 -03:00
parent e2ca18d120
commit 27c0181d77
6 changed files with 47 additions and 28 deletions

View File

@@ -147,7 +147,7 @@ class MonitorWidget(Gtk.Box):
gl_area.make_current()
self._live_player = Player()
self._live_player.init_gl(
update_callback=lambda: GLib.idle_add(self._live_gl.queue_render)
update_callback=lambda: GLib.idle_add(self._live_gl.queue_render, priority=GLib.PRIORITY_HIGH)
)
log.info("Live player created")
if self._live_source_url and not self._live_loaded:
@@ -162,7 +162,7 @@ class MonitorWidget(Gtk.Box):
self._live_loaded = False
def _on_live_render(self, gl_area, _ctx):
if not self._live_player:
if not self._live_player or not self._live_loaded:
return True
fbo = ctypes.c_int(0)
_libGL.glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, ctypes.byref(fbo))
@@ -175,7 +175,7 @@ class MonitorWidget(Gtk.Box):
gl_area.make_current()
self._review_player = Player()
self._review_player.init_gl(
update_callback=lambda: GLib.idle_add(self._review_gl.queue_render)
update_callback=lambda: GLib.idle_add(self._review_gl.queue_render, priority=GLib.PRIORITY_HIGH)
)
log.info("Review player created")

View File

@@ -103,12 +103,9 @@ class Player:
def load_live(self, url):
"""Load a live stream URL with low-latency options."""
self._player["cache"] = "no"
self._player["demuxer-max-bytes"] = "256KiB"
self._player["demuxer-readahead-secs"] = 0
self._player["demuxer-max-bytes"] = "512KiB"
self._player["demuxer-readahead-secs"] = 0.5
self._player["audio-buffer"] = 0.1
self._player["untimed"] = True
self._player["video-latency-hacks"] = True
self._player["interpolation"] = False
log.info("mpv load_live: %s", url)
self._player.loadfile(str(url), mode="replace")