From 2269f347e2a9748c6e75ad5f53a67fc794b3458e Mon Sep 17 00:00:00 2001
From: Nicko98 <39709875+Nicko98@users.noreply.github.com>
Date: Thu, 25 Feb 2021 23:21:29 +0100
Subject: [PATCH]  Fix for issue KrumpetPirate#155

---
 AAXtoMP3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/AAXtoMP3 b/AAXtoMP3
index e729761..e9f4eeb 100755
--- a/AAXtoMP3
+++ b/AAXtoMP3
@@ -684,7 +684,7 @@ do
         #ffmpeg version 4+ and on the output for all older versions.
         split_input=""
         split_output=""
-        if [ "$(($(ffmpeg -version | head -1 | cut -d \  -f 3 | cut -d . -f 1) > 3))" = "1" ]; then
+        if [ "$(($(ffmpeg -version | sed -E 's/[^0-9]*([0-9]).*/\1/g;1q') > 3))" = "1" ]; then
           split_input="-ss ${chapter_start%?} -to ${chapter_end}"
         else
           split_output="-ss ${chapter_start%?} -to ${chapter_end}"