From f567f3160224698ba81bfefad698680715376a17 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Fri, 11 May 2012 00:34:19 +0200 Subject: [PATCH] Fix getBinary --- src/FFMpeg/Binary.php | 2 +- src/FFMpeg/FFMpeg.php | 11 ++--------- tests/src/FFMpeg/BinaryTest.php | 4 ++-- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/FFMpeg/Binary.php b/src/FFMpeg/Binary.php index 5ec061e..d163f2f 100644 --- a/src/FFMpeg/Binary.php +++ b/src/FFMpeg/Binary.php @@ -59,7 +59,7 @@ abstract class Binary implements AdapterInterface $binary = null; foreach (static::getBinaryName() as $candidate) { - if (null !== $binary = $finder->find(static::getBinaryName())) { + if (null !== $binary = $finder->find($candidate)) { break; } } diff --git a/src/FFMpeg/FFMpeg.php b/src/FFMpeg/FFMpeg.php index 39710cf..3da7145 100644 --- a/src/FFMpeg/FFMpeg.php +++ b/src/FFMpeg/FFMpeg.php @@ -174,7 +174,7 @@ class FFMpeg extends Binary * @return \FFMpeg\FFMpeg * @throws Exception\RuntimeException */ - protected function encodeVideo(Format\VideoFormat $format, $outputPathfile, $threads, $control) + protected function encodeVideo(Format\VideoFormat $format, $outputPathfile, $threads) { $cmd_part1 = $this->binary . ' -y -i ' @@ -209,14 +209,7 @@ class FFMpeg extends Binary $process = new Process($pass); try { -// $process->run(); - $process->run(function($data, $dodo) { -// echo $data.$dodo."\nend chunk\n"; - $matches = array(); - preg_match('/time=([0-9:\.]+)/', $dodo, $matches); - if ($matches[1]) - var_dump($matches); - }); + $process->run(); } catch (\RuntimeException $e) { break; } diff --git a/tests/src/FFMpeg/BinaryTest.php b/tests/src/FFMpeg/BinaryTest.php index 76b7c5c..54a29e2 100644 --- a/tests/src/FFMpeg/BinaryTest.php +++ b/tests/src/FFMpeg/BinaryTest.php @@ -43,7 +43,7 @@ class BinaryTester extends Binary protected static function getBinaryName() { - return 'php'; + return array('php'); } } @@ -53,7 +53,7 @@ class BinaryTesterWrongBinary extends Binary protected static function getBinaryName() { - return ''; + return array(''); } }