fix: keep the displayed frame during frame stepping

This commit is contained in:
2026-10-10 18:12:25 +02:00
parent a99b0c1168
commit 2bb7d9b4ee
4 changed files with 14 additions and 11 deletions
+6 -4
View File
@@ -395,13 +395,15 @@ void Output::set_volume(float normalized0to1) noexcept {
float Output::volume() const noexcept {
return impl->targetGain.load(std::memory_order_relaxed);
}
void Output::reset() {
void Output::reset(bool clear_video) {
impl->read.store(0); impl->written.store(0);
impl->origin = 0;
impl->anchorPTS.store(NAN); impl->frozen.store(NAN); impl->endPTS.store(0);
std::lock_guard lock(impl->video->mutex);
av_frame_unref(impl->video->frame);
++impl->video->version;
if (clear_video) {
std::lock_guard lock(impl->video->mutex);
av_frame_unref(impl->video->frame);
++impl->video->version;
}
}
size_t Output::write(const float *samples, size_t frames, double pts) {
uint64_t w = impl->written.load(std::memory_order_relaxed);