Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/Media/VideoCodec.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ enum VideoCodec: string
{
case VP8 = "vp8";
case VP9 = "vp9";
case AV1 = "av1";
case THEORA = "theora";
case MPEG4 = "mpeg4";
case H264 = "h264";
Expand Down
4 changes: 2 additions & 2 deletions core/Util/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,11 @@ function _fatal_error(\Throwable $e): void
<!doctype html>
<html lang="en">
<head>
<title>Internal error - SCore-'.$version.'</title>
<title>Internal Error</title>
</head>
<body>
<h1>Internal Error</h1>
<p><b>Message:</b> '.html_escape($message).'
<p><b>Message:</b> '.$e::class . ": " . html_escape($message).'
'.$q.'
<p><b>Version:</b> '.$version.' (on '.$phpver.')
<p><b>Stack Trace:</b></p><pre><code>'.$e->getTraceAsString().'</code></pre>
Expand Down
6 changes: 5 additions & 1 deletion ext/handle_video/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ protected function media_check_properties(MediaCheckPropertiesEvent $event): voi
break;
case "video":
$event->image->video = true;
$event->image->video_codec = VideoCodec::from($stream["codec_name"]);
try {
$event->image->video_codec = VideoCodec::from($stream["codec_name"]);
} catch (\ValueError $e) {
throw new UserError("Unrecognised video codec: {$stream["codec_name"]}");
}
$event->image->width = max($event->image->width, $stream["width"]);
$event->image->height = max($event->image->height, $stream["height"]);
break;
Expand Down