#!/bin/sh
nt mp
xset s off
exec </dev/tty
: ${geom:=0:0}
: ${alang:=en}

common="--fs --volume-max=800 --geometry=$geom --alang=$alang -keep-open=yes --no-osd-bar --osd-font-size=20 --vf=deband --no-audio-display" # -lavdopts threads=2"

# Option 0: Using x11 (default, but can be CPU intensive)
common_x11="--vo=x11 --hwdec=no"
# Option 1: Using xv (X Video extension, lighter than x11)
common_xv="--vo=xv --hwdec=no"
# Option 2: Using SDL (cross-platform, software rendering)
common_sdl="--vo=sdl --hwdec=no"
# Option 3: VAAPI with minimal GPU usage (if you need some HW decode)
common_vaapi="--vo=x11 --hwdec=vaapi-copy"

# Option 4: Using OpenGL (best quality, but may use more GPU)
common_gl=" --opengl-waitvsync" # -lavdopts threads=2"

options="$common_xv"

trap 'stty sane; exit 1' INT TERM

v mpv $options "$@"

stty sane
