fix: keep the displayed frame during frame stepping
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user