# HG changeset patch # User Matti Hamalainen # Date 1448023491 -7200 # Node ID c0e21a4052565d0d7a0fb71828ec4d3d4927ae09 # Parent b17c41ffe43b2a2bb8ee8a15bc68adc4db1d2fbe Change external tool handling. diff -r b17c41ffe43b -r c0e21a405256 faptool.php --- a/faptool.php Fri Nov 20 13:39:20 2015 +0200 +++ b/faptool.php Fri Nov 20 14:44:51 2015 +0200 @@ -19,13 +19,22 @@ function wtGetExecutable($name, $path = FALSE) { - if (stChkSetting($name)) - return stGetSetting($name); + if (stChkSetting($name."_exe")) + return stGetSetting($name."_exe"); else return $name; } +function wtGetExecutableArgs($name) +{ + if (stChkSetting($name."_args")) + return " ".stGetSetting($name."_args")." "; + else + return ""; +} + + function wtConvertImage($inFilename, $outFilename, $outDim, $outFormat, $outQuality, $thumb, $useGfxConv) { global $setPreviewPath; @@ -37,6 +46,7 @@ $tmpFilename = tempnam($setPreviewPath, "tmp"); $isTemp = TRUE; if (wtExec(wtGetExecutable("gfxconv"), + wtGetExecutableArgs("gfxconv"). escapeshellarg($inFilename)." -f png -o ".escapeshellarg($tmpFilename), 0) === false) return FALSE; @@ -106,7 +116,7 @@ "--samplerate ".$sfreq." ". "--channels ".$schannels." ". "--end-time ".($sduration)." ". - stGetSetting("openmpt123ExtraArgs")." ". + wtGetExecutableArgs("openmpt123"). escapeshellarg($inFilename)." -o ".escapeshellarg($outFilename), 0); } @@ -124,6 +134,7 @@ return wtExec( wtGetExecutable("avconv"), + wtGetExecutableArgs("avconv"). "-y -v 1 -t ".intval($sduration)." ". "-i ".escapeshellarg($inFilename). " ".$optStr." -ac ".$schannels. diff -r b17c41ffe43b -r c0e21a405256 mconfig.inc.php.example --- a/mconfig.inc.php.example Fri Nov 20 13:39:20 2015 +0200 +++ b/mconfig.inc.php.example Fri Nov 20 14:44:51 2015 +0200 @@ -58,7 +58,11 @@ "sampleChannels" => 1, // 1 = mono, 2 = stereo "sampleDuration" => 30, // in seconds - "openmpt123ExtraArgs" => "", // Extra commandline arguments for openmpt123 + //"avconv_exe" => "ffmpeg", // avconv/ffmpeg binary executable + //"gfxconv_exe" => "gfxconv", + //"openmpg123_exe" => "openmpt123", + + "openmpt123_args" => "", // Extra commandline arguments for openmpt123 // Samples to be generated, and their avconv settings "sampleTypes" => array(