Fix Linux audio backend preference and worker footage render crash

- On Linux, automatically prefer PipeWire/JACK/PulseAudio over ALSA
  even when a saved ALSA device name exists in config.
- Restore Footage length after deserialization so worker snapshots
  have valid stream lengths and video playback can advance.
- Guard ResolveDecoderFromInput and ProcessAudioFootage against a
  null decoder cache to prevent worker crashes on direct Footage ->
  ViewerOutput connections.
- Keep Linux signal backtrace handler in the render worker.
- Add Oak project SVG logos.
This commit is contained in:
2026-07-14 22:33:30 +08:00
parent 5c8ce17c7e
commit 3be4294e15
6 changed files with 101 additions and 3 deletions
+12
View File
@@ -317,6 +317,12 @@ RenderProcessor::ResolveDecoderFromInput(const QString &decoder_id,
return nullptr;
}
if (!decoder_cache_) {
qWarning() << "Cannot resolve decoder for" << stream.filename()
<< "without a decoder cache";
return nullptr;
}
QMutexLocker locker(decoder_cache_->mutex());
DecoderPair decoder = decoder_cache_->value(stream);
@@ -599,6 +605,12 @@ void RenderProcessor::ProcessAudioFootage(SampleBuffer &destination,
const FootageJob *stream,
const TimeRange &input_time)
{
// The worker process has no decoder cache and does not decode audio. Bail
// out gracefully rather than letting ResolveDecoderFromInput crash.
if (!decoder_cache_) {
return;
}
DecoderPtr decoder = ResolveDecoderFromInput(
stream->decoder(),
Decoder::CodecStream(stream->filename(),
+24
View File
@@ -20,6 +20,7 @@
#include <cstdio>
#include <cstring>
#include <csignal>
#include <memory>
#include <optional>
@@ -32,6 +33,11 @@
#include <QOpenGLContext>
#include <QSurfaceFormat>
#ifdef Q_OS_LINUX
#include <execinfo.h>
#include <unistd.h>
#endif
#include "common/qtutils.h"
#include "config/config.h"
#include "core.h"
@@ -59,6 +65,18 @@ void HideWorkerDockIcon();
namespace
{
#ifdef Q_OS_LINUX
void PrintBacktrace(int sig)
{
void *array[50];
size_t size = backtrace(array, 50);
fprintf(stderr, "worker: caught signal %d, backtrace:\n", sig);
backtrace_symbols_fd(array, size, STDERR_FILENO);
fflush(stderr);
_exit(128 + sig);
}
#endif
constexpr int kProtocolVersion = 1;
constexpr int kDefaultWidth = 1920;
constexpr int kDefaultHeight = 1080;
@@ -606,6 +624,12 @@ int main(int argc, char *argv[])
}
}
#ifdef Q_OS_LINUX
std::signal(SIGSEGV, PrintBacktrace);
std::signal(SIGABRT, PrintBacktrace);
std::signal(SIGFPE, PrintBacktrace);
#endif
QFile in;
QFile out;
if (!in.open(stdin, QIODevice::ReadOnly | QIODevice::Unbuffered) ||