From 934ed2739a4ce665628a906047dfaf525c9bfca9 Mon Sep 17 00:00:00 2001 From: Igor Kosteski Date: Wed, 21 Feb 2018 16:38:46 +0100 Subject: [PATCH] Media Default Format passing duration parameter to the ProgressListener --- src/FFMpeg/Format/Audio/DefaultAudio.php | 2 +- src/FFMpeg/Format/Video/DefaultVideo.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FFMpeg/Format/Audio/DefaultAudio.php b/src/FFMpeg/Format/Audio/DefaultAudio.php index 4207911..03e855c 100644 --- a/src/FFMpeg/Format/Audio/DefaultAudio.php +++ b/src/FFMpeg/Format/Audio/DefaultAudio.php @@ -124,7 +124,7 @@ abstract class DefaultAudio extends EventEmitter implements AudioInterface, Prog public function createProgressListener(MediaTypeInterface $media, FFProbe $ffprobe, $pass, $total, $duration = 0) { $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) { $format->emit('progress', array_merge(array($media, $format), func_get_args())); }); diff --git a/src/FFMpeg/Format/Video/DefaultVideo.php b/src/FFMpeg/Format/Video/DefaultVideo.php index 0e7675c..3b1eef8 100644 --- a/src/FFMpeg/Format/Video/DefaultVideo.php +++ b/src/FFMpeg/Format/Video/DefaultVideo.php @@ -128,7 +128,7 @@ abstract class DefaultVideo extends DefaultAudio implements VideoInterface public function createProgressListener(MediaTypeInterface $media, FFProbe $ffprobe, $pass, $total, $duration = 0) { $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) { $listener->on('progress', function () use ($format, $media) {