fix: dangling OpenGL context crash and uninitialized audio frame size

- OpenGLRenderer: hold the viewer-owned QOpenGLContext in a QPointer so
  DestroyInternal() safely skips it when the context has already been
  destroyed by Qt's shared-context lifecycle. Fixes a SIGSEGV when the
  full gtest suite ran MainWindow.ConstructsOffscreenWithPanelsAndMenus
  after earlier viewer tests.
- PreviewAudioDevice: add SetParams() deriving bytes_per_frame from the
  audio format (bytes per sample * channel count) instead of staying 0.
This commit is contained in:
2026-07-19 13:58:06 +08:00
parent 842bc7632b
commit b0aa683499
4 changed files with 28 additions and 6 deletions
+5
View File
@@ -42,6 +42,11 @@ bool PreviewAudioDevice::isSequential() const
return true;
}
void PreviewAudioDevice::SetParams(const core::AudioParams &params)
{
set_bytes_per_frame(params.samples_to_bytes(1));
}
qint64 PreviewAudioDevice::readData(char *data, qint64 maxSize)
{
QMutexLocker locker(&lock_);