Skip to content

Commit

Permalink
fix(AudioHandler): Fix instantiating FFProbe
Browse files Browse the repository at this point in the history
  • Loading branch information
octfx committed Jul 18, 2023
1 parent 279c52b commit 50d92e8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions includes/Media/AudioHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,17 +284,19 @@ public function getSizeAndMetadata( $state, $path ) {
* @return array
*/
protected function getFFProbeResult( $file, string $select = 'v:0' ): array {
$path = $file;

if ( $file instanceof File ) {
$file = $file->getLocalRefPath();
$path = $file->getLocalRefPath();
} elseif ( $file instanceof FSFile ) {
$file = $file->getPath();
$path = $file->getPath();
}

if ( $file === false ) {
return [];
}

$probe = new FFProbe( $file );
$probe = new FFProbe( $path, $file );

return [
'stream' => $probe->getStream( $select ),
Expand Down

0 comments on commit 50d92e8

Please sign in to comment.