#!/bin/sh
if [ -z "$1" ]; then
echo "Usage: $0 <hmtfile>"
exit 1
fi
flag=0
for bm in $(hmt -bookmarks "$1"); do
if [ $flag -eq 0 ]; then
echo "#EXTVLCOPT:start-time=$bm"
else
echo "#EXTVLCOPT:stop-time=$bm"
echo $(basename "$1" .hmt).ts
fi
flag=$((flag^1))
done