From 0526404d1981d8531b2e66a197011016634c3dfc Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Fri, 8 Jan 2021 16:09:00 -0800 Subject: [PATCH] Put suggested ffmpeg version into constants file --- config/constants.go | 11 ++++++----- config/verifyInstall.go | 5 ++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/constants.go b/config/constants.go index ef68dcafd..cedc203d2 100644 --- a/config/constants.go +++ b/config/constants.go @@ -3,11 +3,12 @@ package config import "path/filepath" const ( - WebRoot = "webroot" - PrivateHLSStoragePath = "hls" - GeoIPDatabasePath = "data/GeoLite2-City.mmdb" - ExtraInfoFile = "data/content.md" - StatsFile = "data/stats.json" + WebRoot = "webroot" + PrivateHLSStoragePath = "hls" + GeoIPDatabasePath = "data/GeoLite2-City.mmdb" + ExtraInfoFile = "data/content.md" + StatsFile = "data/stats.json" + FfmpegSuggestedVersion = "v4.1.5" // Requires the v ) var ( diff --git a/config/verifyInstall.go b/config/verifyInstall.go index 3e4932432..0e83c3549 100644 --- a/config/verifyInstall.go +++ b/config/verifyInstall.go @@ -32,7 +32,6 @@ func verifyFFMpegPath(path string) error { return errors.New("ffmpeg path is not executable") } - suggestedVersion := "v4.1.5" cmd := exec.Command(path) out, err := cmd.CombinedOutput() @@ -45,8 +44,8 @@ func verifyFFMpegPath(path string) error { responseComponents := strings.Split(response, " ") fullVersionString := responseComponents[2] versionString := "v" + strings.Split(fullVersionString, "-")[0] - if !semver.IsValid(versionString) || semver.Compare(versionString, suggestedVersion) == -1 { - return fmt.Errorf("your %s version of ffmpeg at %s may be older than the suggested version of %s. you may experience issues with video.", versionString, path, suggestedVersion) + if !semver.IsValid(versionString) || semver.Compare(versionString, FfmpegSuggestedVersion) == -1 { + return fmt.Errorf("your %s version of ffmpeg at %s may be older than the suggested version of %s. you may experience issues with video.", versionString, path, FfmpegSuggestedVersion) } return nil