audio: master-clock playback timing, output clock compensation, buffer config, interpolated speed

- playback timer uses the audio output device as its master clock: the
  PortAudio callback counts consumed frames (including underrun
  zero-fill) so video cannot drift away from what is heard; wall clock
  remains as fallback when no clocked output is running
- output clock compensates for device output latency; new Preferences >
  Audio buffer size setting (0 = auto)
- SampleBuffer::speed() now uses linear interpolation instead of
  nearest-neighbor sampling
- regression tests: audio-clock driven timer (fwd/rev/speed), wall
  clock fallback, interpolation correctness
This commit is contained in:
2026-07-19 21:44:34 +08:00
parent 0c02ff0d77
commit a7ddc0f114
16 changed files with 266 additions and 8 deletions
+4
View File
@@ -210,6 +210,10 @@ void Config::set_defaults()
QStringLiteral("AudioOutputSampleFormat"), NodeValue::k_text,
QString::fromStdString(SampleFormat(SampleFormat::s16).to_string()));
// Output buffer size in frames, 0 = let PortAudio/the device decide
set_entry_internal(QStringLiteral("AudioOutputBufferSize"), NodeValue::k_int,
0);
set_entry_internal(QStringLiteral("AudioRecordingFormat"), NodeValue::k_int,
ExportFormat::k_format_wav);
set_entry_internal(QStringLiteral("AudioRecordingCodec"), NodeValue::k_int,