matanui159 / ReplaySorcery

An open-source, instant-replay solution for Linux
GNU General Public License v3.0
853 stars 27 forks source link

Fix odd resolutions in x264 encoder #47

Closed melvyn2 closed 3 years ago

melvyn2 commented 4 years ago

Fix odd resolutions crashing the encoder (usually from multiple monitors). Example:

x264 [error]: width not divisible by 2 (3839x1080)
Signal error: Segment violation
matanui159 commented 4 years ago

Also add yourself to the CREDITS.md if you want

melvyn2 commented 4 years ago

Formatting is fixed, I'm fine without credit.

matanui159 commented 4 years ago

On second look, I'm not sure how it gets this far in the first place. Odd resolutions should be blocked by the config: https://github.com/matanui159/ReplaySorcery/blob/master/src/config.c#L60

melvyn2 commented 4 years ago

I didn't set a resolution in the config (I don't have a config at all), so perhaps the auto-set resolution bypasses the check.

matanui159 commented 4 years ago

Maybe the odd-size correction as part of the automatic resolution detection (although I don't know why you have odd dimensions)

melvyn2 commented 4 years ago

It seems that before, my second monitor was offset by 1919 pixels instead of 1920 pixels. Running xrandr --output (display2) --right-of (display1) fixed it. I still think the issue is valid though.