When bitrate is updated, a check against 'lookahead' setting is done.
If 'lookahead' is enabled, the bitrate update is disabled.
We indeed used to observe crashes with nvenc when frequent bitrate
resettings were effected while lookahead option was enabled.
But recent tests have shown that the issue is gone.
As a result this commit allows 'lookahead' with bitrate live update.
Signed-off-by: pkv <pkv@obsproject.com>
FFmpeg wipes priv_data if the encoder fails to start, so we need some
way of knowing if the GPU index was non-zero. This is a bit ugly but the
best way to do it for now.
This writes the result of nvEncGetLastErrorString to the last encoder
error instead of just the log file. This makes it user-visible, which
should help users diagnose and solve the problem.
Also strips off leading colons from NVENC error strings as these can
look odd given our format string. An example of such an error:
::NV_ENC_TWO_PASS_FULL_RESOLUTION is only supported multipass encoding
on this architecture.
When adding to the queue, this triggers rowCountChanged which then
calls canClearFinished, reading undefined memory for state if this is
not set. The correct state is set immediately after by checkInputPath.
Detected by UBSan.
When an external display is disconnected with a fullscreen projector
attached to it, Qt will trigger a resize of the window twice, which
makes the renderer queue 2 resize event blocks.
At the time when those blocks are run, Qt's window destructor will have
reset all pointers, and the block directly accesses pointers within
structures identified by pointers, which are invalid by that point.
This commit makes a block return early if the associated window has
been destroyed already and also explicitly checks for valid pointers
after.
Receiving buffers flagged as corrupted, or empty, is a casualty of
how things are implemented in various compositors, and it's not
a critical situation to be afraid of. We can expect a few buffers
to be flagged as corrupted here and there, and that's fine.
Demote these warnings to debug messages, as they're still useful
for debugging.
The crash reporter made with Qt was introduced in 824c7b0, but then was
quickly replaced by a native OS implementation in d42a7ce. This code has
been lying around ever since.