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:
@@ -22,6 +22,8 @@
|
||||
#ifndef PREVIEWAUDIODEVICE_H
|
||||
#define PREVIEWAUDIODEVICE_H
|
||||
|
||||
#include <olive/core/render/audioparams.h>
|
||||
|
||||
#include "previewautocacher.h"
|
||||
|
||||
namespace olive
|
||||
@@ -42,6 +44,11 @@ public:
|
||||
|
||||
virtual qint64 writeData(const char *data, qint64 length) override;
|
||||
|
||||
// Derives the frame size from the audio format (bytes per sample per
|
||||
// channel * channel count). Until params are set, bytes_per_frame()
|
||||
// reports 0, i.e. "unknown".
|
||||
void SetParams(const core::AudioParams ¶ms);
|
||||
|
||||
int bytes_per_frame() const
|
||||
{
|
||||
return bytes_per_frame_;
|
||||
|
||||
Reference in New Issue
Block a user