Fix mpv resolution

Aspect ratio calculation resulted in 0.00 on RG28xx which lead to the
wrong resolution being set.
Direct comparision between values simplifies the code as well.
This commit is contained in:
Loosefish
2025-08-31 15:42:32 +02:00
parent 22737bb314
commit 34d7a9601c

View File

@@ -10,16 +10,11 @@ systemctl start mpv
FBWIDTH="$(fbwidth)"
FBHEIGHT="$(fbheight)"
ASPECT=$(printf "%.2f" $(echo "(${FBWIDTH} / ${FBHEIGHT})" | bc -l))
case ${ASPECT} in
1.*)
RES="${FBWIDTH}x${FBHEIGHT}"
;;
0.*)
RES="${FBHEIGHT}x${FBWIDTH}"
;;
esac
if [[ ${FBWIDTH} -ge ${FBHEIGHT} ]]; then
RES="${FBWIDTH}x${FBHEIGHT}"
else
RES="${FBHEIGHT}x${FBWIDTH}"
fi
/usr/bin/mpv --fullscreen --geometry=${RES} --hwdec=auto-safe --input-gamepad=yes --input-ipc-server=/tmp/mpvsocket "${1}"
systemctl stop mpv