philhk / Vencord

The cutest Discord client mod
GNU General Public License v3.0
59 stars 24 forks source link

[Bug] custom FPS does not work on servers without Server Boost or in DM without Nitro #21

Open fdkchx opened 6 months ago

fdkchx commented 6 months ago

Discord Account

kosmoxapka

What happens when the bug or crash occurs?

custom FPS does not work on servers without Server Boost or in DM without Nitro

What is the expected behaviour?

custom FPS will work again for example, the CustomScreenShare plugin allows you to do this without any problems

How do you recreate this bug or crash?

opened betterscreenshare settings, disabled simple, set framerate to 75.

Errors

Replace this text with your crash-log.

Request Agreement

Loukious commented 5 months ago

Works fine for me. You just have to open the menu and press apply again.

BlueberryWolf commented 5 months ago

Works fine for me. You just have to open the menu and press apply again.

I was able to replicate it. it only happens specifically in servers with no boosts for me.

BlueberryWolf commented 5 months ago

Works fine for me. You just have to open the menu and press apply again.

I was able to replicate it. it only happens specifically in servers with no boosts for me.

nevermind. it doesn't work for me at all in any server.

Loukious commented 5 months ago

Works fine for me. You just have to open the menu and press apply again.

I was able to replicate it. it only happens specifically in servers with no boosts for me.

nevermind. it doesn't work for me at all in any server.

Did you open the menu and press "apply" again AFTER you started streaming? image

BlueberryWolf commented 5 months ago

yep, then discord immediately crashes for me. it only started occurring to me after I restarted my PC recently. Discord's console throws an error, "Invalid Framerate: 144"

BlueberryWolf commented 5 months ago

image image

BlueberryWolf commented 5 months ago

image here are my settings

BlueberryWolf commented 5 months ago

I've tried reinstalling stable discord, and also using the development branch. I'll try canary in a bit

BlueberryWolf commented 5 months ago

image

BlueberryWolf commented 5 months ago

I made a patch to fix it, it no longer crashes. I'll make a pull request in a second here.

All you have to do is return e on the default case, as it is a clientsided check

BlueberryWolf commented 5 months ago

holy fuck the issue is bigger than I thought. if you even view a stream that is at a non-standard framerate, it crashes everyone else's discord

basically, what I mean is, the client throws that error if you send or receive a stream of an invalid framerate. If you remove the clientsided check, you can still stream at 144FPS, but it will crash everyone else's client if they view it.

Loukious commented 5 months ago

holy fuck the issue is bigger than I thought. if you even view a stream that is at a non-standard framerate, it crashes everyone else's discord

basically, what I mean is, the client throws that error if you send or receive a stream of an invalid framerate. If you remove the clientsided check, you can still stream at 144FPS, but it will crash everyone else's client if they view it.

I also fixed it myself and I tried lmao. Yep it was crashing for everyone else who tries to enter the stream.

BlueberryWolf commented 5 months ago

I managed to bypass it and avoid the crashes. I'll make a pull request.

BlueberryWolf commented 5 months ago

well actually no, that doesn't work. I tried spoofing MaxFrameRate, and keeping EncodingVideoFrameRate at what you set it to, but it turns out that MaxFrameRate is the max speed at which the client can play back the video stream. I have to rethink this.