Fix Clipping video transcoding progress not correct
This commit is contained in:
parent
2649d45b7b
commit
53a978e021
6 changed files with 25 additions and 8 deletions
|
|
@ -121,7 +121,7 @@ abstract class DefaultAudio extends EventEmitter implements AudioInterface, Prog
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function createProgressListener(MediaTypeInterface $media, FFProbe $ffprobe, $pass, $total)
|
||||
public function createProgressListener(MediaTypeInterface $media, FFProbe $ffprobe, $pass, $total, $duration = 0)
|
||||
{
|
||||
$format = $this;
|
||||
$listener = new AudioProgressListener($ffprobe, $media->getPathfile(), $pass, $total);
|
||||
|
|
|
|||
|
|
@ -80,12 +80,13 @@ abstract class AbstractProgressListener extends EventEmitter implements Listener
|
|||
*
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public function __construct(FFProbe $ffprobe, $pathfile, $currentPass, $totalPass)
|
||||
public function __construct(FFProbe $ffprobe, $pathfile, $currentPass, $totalPass, $duration = 0)
|
||||
{
|
||||
$this->ffprobe = $ffprobe;
|
||||
$this->pathfile = $pathfile;
|
||||
$this->currentPass = $currentPass;
|
||||
$this->totalPass = $totalPass;
|
||||
$this->duration = $duration;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -255,7 +256,7 @@ abstract class AbstractProgressListener extends EventEmitter implements Listener
|
|||
}
|
||||
|
||||
$this->totalSize = $format->get('size') / 1024;
|
||||
$this->duration = $format->get('duration');
|
||||
$this->duration = (int) $this->duration > 0 ? (int) $this->duration : $format->get('duration');
|
||||
|
||||
$this->initialized = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,8 +24,9 @@ interface ProgressableInterface extends EventEmitterInterface
|
|||
* @param FFProbe $ffprobe
|
||||
* @param Integer $pass The current pas snumber
|
||||
* @param Integer $total The total pass number
|
||||
* @param Integer $duration The new video duration
|
||||
*
|
||||
* @return array An array of listeners
|
||||
*/
|
||||
public function createProgressListener(MediaTypeInterface $media, FFProbe $ffprobe, $pass, $total);
|
||||
public function createProgressListener(MediaTypeInterface $media, FFProbe $ffprobe, $pass, $total, $duration = 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ abstract class DefaultVideo extends DefaultAudio implements VideoInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function createProgressListener(MediaTypeInterface $media, FFProbe $ffprobe, $pass, $total)
|
||||
public function createProgressListener(MediaTypeInterface $media, FFProbe $ffprobe, $pass, $total, $duration = 0)
|
||||
{
|
||||
$format = $this;
|
||||
$listeners = array(new VideoProgressListener($ffprobe, $media->getPathfile(), $pass, $total));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue