diff --git a/__pycache__/channels.cpython-313.pyc b/__pycache__/channels.cpython-313.pyc new file mode 100644 index 0000000..91a0653 Binary files /dev/null and b/__pycache__/channels.cpython-313.pyc differ diff --git a/__pycache__/osd.cpython-313.pyc b/__pycache__/osd.cpython-313.pyc new file mode 100644 index 0000000..600dae5 Binary files /dev/null and b/__pycache__/osd.cpython-313.pyc differ diff --git a/__pycache__/player.cpython-313.pyc b/__pycache__/player.cpython-313.pyc new file mode 100644 index 0000000..dd53e15 Binary files /dev/null and b/__pycache__/player.cpython-313.pyc differ diff --git a/__pycache__/qt_process.cpython-313.pyc b/__pycache__/qt_process.cpython-313.pyc new file mode 100644 index 0000000..643b89d Binary files /dev/null and b/__pycache__/qt_process.cpython-313.pyc differ diff --git a/__pycache__/server.cpython-313.pyc b/__pycache__/server.cpython-313.pyc new file mode 100644 index 0000000..273db3a Binary files /dev/null and b/__pycache__/server.cpython-313.pyc differ diff --git a/__pycache__/utils.cpython-313.pyc b/__pycache__/utils.cpython-313.pyc new file mode 100644 index 0000000..97fdfec Binary files /dev/null and b/__pycache__/utils.cpython-313.pyc differ diff --git a/__pycache__/volume.cpython-313.pyc b/__pycache__/volume.cpython-313.pyc new file mode 100644 index 0000000..a1cd123 Binary files /dev/null and b/__pycache__/volume.cpython-313.pyc differ diff --git a/__pycache__/volume_osd.cpython-313.pyc b/__pycache__/volume_osd.cpython-313.pyc new file mode 100644 index 0000000..c444394 Binary files /dev/null and b/__pycache__/volume_osd.cpython-313.pyc differ diff --git a/player.py b/player.py index 06278ee..3468874 100755 --- a/player.py +++ b/player.py @@ -5,6 +5,7 @@ import mpv import threading import time import traceback +from utils import hwdec class Player: """MPV player wrapper with IPMPV-specific functionality.""" @@ -15,7 +16,7 @@ class Player: self.player = mpv.MPV( log_handler=self.error_check, vo='gpu', - hwdec='auto-safe', + hwdec=hwdec if hwdec is not None else 'auto-safe', demuxer_lavf_o='reconnect=1', deinterlace='no', keepaspect='no', @@ -44,7 +45,7 @@ class Player: def error_check(self, loglevel, component, message): """Check for errors in MPV logs.""" print(f"[{loglevel}] {component}: {message}") - if loglevel == 'error' and (component == 'ffmpeg' or component == 'cplayer') and 'Failed' in message: + if loglevel == 'error' and (component == 'ffmpeg' or component == 'cplayer') and 'Failed to recognize file format' in message: self.player.loadfile("./nosignal.png") self.to_qt_queue.put({ 'action': 'start_close' @@ -142,7 +143,7 @@ class Player: self.player['video-sync'] = 'audio' self.player['interpolation'] = 'no' self.player['video-latency-hacks'] = 'yes' if self.low_latency else 'no' - self.player['stream-buffer-size'] = '4k' if self.low_latency else '128k' + self.player['stream-buffer-size'] = '4k' if self.low_latency else '512k' return self.low_latency def stop(self): diff --git a/utils.py b/utils.py index 9abb244..7b1b0f8 100755 --- a/utils.py +++ b/utils.py @@ -10,6 +10,7 @@ is_wayland = "WAYLAND_DISPLAY" in os.environ osd_corner_radius = os.environ.get("IPMPV_CORNER_RADIUS") ipmpv_retroarch_cmd = os.environ.get("IPMPV_RETROARCH_CMD") m3u_url = os.environ.get('IPMPV_M3U_URL') +hwdec = os.environ.get('IPMPV_HWDEC') def setup_environment(): """Set up environment variables."""