# HG changeset patch # User Matti Hamalainen # Date 1417128220 -7200 # Node ID dc3ac7470ec0794f9a68948c28339256f88e4390 # Parent 7accae8e896ccea30596f45ab90c463d212cdfef Moar work. diff -r 7accae8e896c -r dc3ac7470ec0 faptool.php --- a/faptool.php Fri Nov 28 00:23:55 2014 +0200 +++ b/faptool.php Fri Nov 28 00:43:40 2014 +0200 @@ -121,15 +121,19 @@ } -function wtConvertSample($inFilename, $outFilename, $opts) +function wtConvertSample($inFilename, $outFilename, $type) { $sfreq = intval(stGetSetting("sampleFreq")); $sduration = intval(stGetSetting("sampleDuration")); $schannels = intval(stGetSetting("sampleChannels")); - foreach ($opts as $okey => $oval) + $stypes = stGetSetting("sampleTypes"); + if (!isset($stypes[$type])) + die("ERROR: Specified sample type '".$type."' not defined in sampleTypes in mconfig.inc.php\n"); + + foreach ($stypes[$type] as $okey => $oval) $optStr .= $okey." ".$oval." "; - + return wtExec( "/usr/local/bin/avconv", "-y -t ".intval($sduration)." ". @@ -143,7 +147,10 @@ function wtPurgeDir($path) { if (file_exists($path)) - wtExecOrDie("/bin/echo", "-fR ".escapeshellarg($path)); + { + echo "PURGING: ".$path."\n"; + //wtExecOrDie("/bin/echo", "-fR ".escapeshellarg($path)); + } } @@ -200,14 +207,16 @@ return FALSE; // Scan through files ... + $res = FALSE; $dir = opendir($path); while (($dentry = readdir($dir)) !== false) { + $fname = $path."/".$dentry; } closedir($dir); wtPurgeDir($path); - return TRUE; + return $res; } @@ -305,7 +314,7 @@ wtScanArchive( $efile, stMakePath(FALSE, TRUE, array($setEntryPath, $compo["cpath"], $efile["filename"]), - "wtCheckOneArchiveFile", $compo["preview_type"]); + "wtHandleSingleEntryPreviewDispatch", array($compo, $entry, $pdata)); unpack to tempdir if compo preview type is image, scan archive for images ..