diff --git a/application/libraries/Librivox_id3tag.php b/application/libraries/Librivox_id3tag.php index 82b0aef3..46cde18b 100644 --- a/application/libraries/Librivox_id3tag.php +++ b/application/libraries/Librivox_id3tag.php @@ -161,6 +161,7 @@ function _create_files_table($dir, $map = array(), $freeze = false) //analyze volume $mp3gain_result = $this->librivox_mp3gain->analyze_file($dir, $file); + if (! $mp3gain_result) continue; $file_array = $this-> _create_file_array($freeze); //prototype diff --git a/application/libraries/Librivox_mp3gain.php b/application/libraries/Librivox_mp3gain.php index 7e89db33..51f6ea2f 100644 --- a/application/libraries/Librivox_mp3gain.php +++ b/application/libraries/Librivox_mp3gain.php @@ -68,9 +68,13 @@ public function analyze_file($dir, $file_name) $command = $this->mp3gain . ' ' . $this->flag . $dir. $file_name; exec($command, $output); - $parts = explode("\t", $output[1]); + if (count($output) > 1) { + $parts = explode("\t", $output[1]); + return $parts; + } else { + return false; + } - return $parts; } @@ -89,4 +93,4 @@ public function adjust($dir, $map) unset($output); } } -} \ No newline at end of file +}