#!/bin/sh
set -e
set -x

ffmpeg -y -i sample.wav -c:a flac -compression_level 12 -f flac sample.flac </dev/null
ffmpeg -y -i sample.flac -f s16le - </dev/null > sample.flac.pcm
ffmpeg -y -i sample.wav -f s16le - </dev/null > sample.wav.pcm

cmp sample.wav.pcm sample.flac.pcm &&
  echo decode ok, bug not reproduced ||
  echo decode failed, bug reproduced

# sample file is:
#   track 1 "しあわせの花便り"
#   from FGSO-0011 "はるいろステップ"
#   (C) 2018 Foxtail-Grass Studio

