1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 10:19:35 +02:00

Fix "height not divisible by 2" ffmpeg error

This commit is contained in:
Chocobozzz 2021-06-08 11:28:51 +02:00
parent 5982ffc4b5
commit 318b0bd0c2
No known key found for this signature in database
GPG key ID: 583A612D890159BE
3 changed files with 31 additions and 8 deletions

View file

@ -243,6 +243,18 @@ function execShell (command: string, options?: ExecOptions) {
// ---------------------------------------------------------------------------
function isOdd (num: number) {
return (num % 2) !== 0
}
function toEven (num: number) {
if (isOdd) return num + 1
return num
}
// ---------------------------------------------------------------------------
function promisify0<A> (func: (cb: (err: any, result: A) => void) => void): () => Promise<A> {
return function promisified (): Promise<A> {
return new Promise<A>((resolve: (arg: A) => void, reject: (err: any) => void) => {
@ -310,5 +322,8 @@ export {
execPromise,
pipelinePromise,
parseSemVersion
parseSemVersion,
isOdd,
toEven
}