#!/usr/bin/env bash
# Launch wrapper for r36s-dlna-browser on ArkOS / R36S
# Requires: conda env r36s-dlna-browser, system gstreamer1.0-libav installed via apt.
#
# System plugin path makes avdec_h264/aac available (conda gst-libav has broken deps on aarch64).
# LD_PRELOAD is required to work around "cannot allocate memory in static TLS block" for libgomp.
export GST_PLUGIN_PATH=/usr/lib/aarch64-linux-gnu/gstreamer-1.0
export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libgomp.so.1

CONDA_ENV=/home/ark/miniconda3/envs/r36s-dlna-browser
exec "$CONDA_ENV/bin/python" -m r36s_dlna_browser "$@"
