-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
a few typos #19
base: master
Are you sure you want to change the base?
a few typos #19
Conversation
a handful of lil typos found while typechecking the codebase. despite them being obvious typos, I did not apply these changes to master because the fix might break things: - `new Date().time` doesn't exist, so the check was always failing and returning stats even if they are stale. fixing the typo makes it return `null` when stats are stale, as intended. - an attribute was named `maxa` instead of `max`. fixing it could break code relying on the typo.
@@ -64,8 +64,8 @@ class VideoEncoder extends Emitter | |||
const scaleResolutionToHeight = params.scaleResolutionToHeight ? parseInt(params.scaleResolutionToHeight) : 0; | |||
const allowedDownScaling = scaleResolutionToHeight && params.hasOwnProperty("allowSameHeight")? (params.allowSameHeight ? 1 : 2) : 0; | |||
//Get default for width and heights | |||
const width = parseInt(params.width) ? parseInt(params.width) : (scaleResolutionDownBy ? 640 : 0); | |||
const height = parseInt(params.height) ? parseInt(params.height) : (scaleResolutionDownBy ? 480 : 0); | |||
const width = params.width ? parseInt(params.width) : (scaleResolutionDownBy ? 640 : 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to sanitize input data, iirc swig crashes if wrong type is used
const width = params.width ? parseInt(params.width) : (scaleResolutionDownBy ? 640 : 0); | |
const width = parseInt(params.width) ?? 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your suggestion removes the default of 640, are you sure we want that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that should be the ultimate goal, we can be consertative and just do this instead
const width = params.width ? parseInt(params.width) : (scaleResolutionDownBy ? 640 : 0); | |
const width = parseInt(params.width) ?? (scaleResolutionDownBy ? 640 : 0); |
a handful of lil typos found while typechecking the codebase. despite them being obvious typos, I did not apply these changes to master because the fix might break things:
new Date().time
doesn't exist, so the check was always failing and returning stats even if they are stale. fixing the typo makes it returnnull
when stats are stale, as intended.an attribute was named
maxa
instead ofmax
. fixing it could break code relying on the typo.