Skip to content

Commit dc6dadd

Browse files
authored
Merge pull request #82 from mhugot/feature/fix-warning-3
fix others warning
2 parents 4d0adad + e2dafae commit dc6dadd

4 files changed

Lines changed: 10 additions & 6 deletions

File tree

src/activities/TranscodeAssetActivity.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class TranscodeAssetActivity extends BasicActivity
3333
const TMP_PATH_OPEN_FAIL = "TMP_PATH_OPEN_FAIL";
3434

3535
private $output;
36+
private $outputs;
3637
private $outputFilesPath;
3738

3839
public function __construct($client, $params, $debug, $cpeLogger)

src/activities/transcoders/BasicTranscoder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ public function _extractFileInfo($metadata) {
142142
'codec' => $videoStreams->codec_name,
143143
'color' => @$videoStreams->color_space,
144144
'resolution' => $videoStreams->width . 'x' . $videoStreams->height,
145-
'sar' => $videoStreams->sample_aspect_ratio,
146-
'dar' => $videoStreams->display_aspect_ratio,
145+
'sar' => $videoStreams->sample_aspect_ratio ?? null,
146+
'dar' => $videoStreams->display_aspect_ratio ?? null,
147147
'framerate' => $videoStreams->r_frame_rate,
148148
'bitrate' => isset($videoStreams->bit_rate) ? (int)$videoStreams->bit_rate : null
149149
],

src/activities/transcoders/ImageTranscoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function transcode_asset(
3939
$tmpPathInput,
4040
$pathToInputFile,
4141
$pathToOutputFiles,
42-
$metadata = null,
42+
$metadata,
4343
$outputWanted)
4444
{
4545
if ($metadata) {

src/activities/transcoders/VideoTranscoder.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function transcode_asset(
5959
$tmpInputPath,
6060
$inputFilePath,
6161
$outputFilesPath,
62-
$metadata = null,
62+
$metadata,
6363
$outputWanted)
6464
{
6565
/* if (!$metadata) */
@@ -316,7 +316,7 @@ private function craft_ffmpeg_cmd_thumb(
316316
$snapshot_sec = $outputWanted->{'snapshot_sec'};
317317
}
318318

319-
$time = gmdate("H:i:s", $snapshot_sec) . ".000";
319+
$time = gmdate("H:i:s", (int)$snapshot_sec) . ".000";
320320
$outputFilesPath .= "/" . $outputFileInfo['basename'];
321321
$frameOptions = " -ss $time -vframes 1";
322322
}
@@ -481,7 +481,7 @@ private function set_output_video_size(&$metadata, $outputWanted)
481481
$height = $outputSizeSplit[1];
482482

483483
// We have a rotation. We flip width and height
484-
if ($metadata['video']['tags'] &&
484+
if (isset($metadata['video']['tags']) &&
485485
$metadata['video']['tags']['rotate'] &&
486486
($metadata['video']['tags']['rotate'] == 90 ||
487487
$metadata['video']['tags']['rotate'] == -90)) {
@@ -524,6 +524,9 @@ public function capture_progression($params, $out, $outErr)
524524
}
525525

526526
// Perform Time transformation to get seconds
527+
if ($last === null) {
528+
return 0;
529+
}
527530
$ar = array_reverse(explode(":", $last));
528531
$done = floatval($ar[0]);
529532
if (!empty($ar[1])) {

0 commit comments

Comments
 (0)