persistent_remove FFMPEG_RELEASE &&
list_remove FFMPEG_HTTPS openssl
list_remove FFMPEG_HTTPS openssl-1.1
list_remove FFMPEG_HTTPS libressl
. $GRIMOIRE/config_query_multi.function &&
default_configure &&

# backporting legacy options
if [[ -n "$FFMPEG_SWSCALE" ]]; then
  persistent_add FFMPEG_OPTS &&
  list_add "FFMPEG_OPTS" "$FFMPEG_SWSCALE" &&

  persistent_remove FFMPEG_SWSCALE
fi &&

config_query_option FFMPEG_OPTS "Enable software scaler support?" y \
                                "--enable-swscale" \
                                "--disable-swscale" &&

config_query_option FFMPEG_OPTS "Enable debugging symbols?" y \
                                "--enable-debug" \
                                "--disable-debug" &&

config_query_option FFMPEG_OPTS "Enable support for Blackmagick Decklink output?" n \
                                "--enable-decklink" \
                                "--disable-decklink" &&

persistent_add FFMPEG_PROGRAM_LIST &&
local FFMPEG_PROGRAM_LIST="ffmpeg ffprobe" &&
config_query_multi FFMPEG_PROGRAMS "Which command line programs would you like to build?" \
                                   $FFMPEG_PROGRAM_LIST \
                                   all \
                                   none &&

config_query_list FFMPEG_HTTPS "how to support https"\
                gnutls SSL none
