Merge pull request #485 from igorkosteski/master

Fix Clipping video transcoding progress not correct #2
This commit is contained in:
Jens Hausdorf 2018-02-21 20:24:02 +01:00 committed by GitHub
commit e91b2276e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -124,7 +124,7 @@ abstract class DefaultAudio extends EventEmitter implements AudioInterface, Prog
public function createProgressListener(MediaTypeInterface $media, FFProbe $ffprobe, $pass, $total, $duration = 0) public function createProgressListener(MediaTypeInterface $media, FFProbe $ffprobe, $pass, $total, $duration = 0)
{ {
$format = $this; $format = $this;
$listener = new AudioProgressListener($ffprobe, $media->getPathfile(), $pass, $total); $listener = new AudioProgressListener($ffprobe, $media->getPathfile(), $pass, $total, $duration);
$listener->on('progress', function () use ($media, $format) { $listener->on('progress', function () use ($media, $format) {
$format->emit('progress', array_merge(array($media, $format), func_get_args())); $format->emit('progress', array_merge(array($media, $format), func_get_args()));
}); });

View file

@ -128,7 +128,7 @@ abstract class DefaultVideo extends DefaultAudio implements VideoInterface
public function createProgressListener(MediaTypeInterface $media, FFProbe $ffprobe, $pass, $total, $duration = 0) public function createProgressListener(MediaTypeInterface $media, FFProbe $ffprobe, $pass, $total, $duration = 0)
{ {
$format = $this; $format = $this;
$listeners = array(new VideoProgressListener($ffprobe, $media->getPathfile(), $pass, $total)); $listeners = array(new VideoProgressListener($ffprobe, $media->getPathfile(), $pass, $total, $duration));
foreach ($listeners as $listener) { foreach ($listeners as $listener) {
$listener->on('progress', function () use ($format, $media) { $listener->on('progress', function () use ($format, $media) {