Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix audio filter to use copy of frame #387

Merged
merged 1 commit into from
Jul 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/QtAVPlayer/qavaudiofilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ int QAVAudioFilter::write(const QAVFrame &frame)
return AVERROR(EAGAIN);

d->sourceFrame = frame;
AVFrame *decoded_frame = frame.frame();
AVRational decoded_frame_tb = frame.stream().stream()->time_base;
AVFrame *decoded_frame = d->sourceFrame.frame();
AVRational decoded_frame_tb = d->sourceFrame.stream().stream()->time_base;
// TODO: clear filter_in_rescale_delta_last
if (!d->inputs.isEmpty() && decoded_frame->pts != AV_NOPTS_VALUE) {
decoded_frame->pts = av_rescale_delta(decoded_frame_tb, decoded_frame->pts,
Expand All @@ -70,7 +70,7 @@ int QAVAudioFilter::write(const QAVFrame &frame)
}

for (auto &filter : d->inputs) {
QAVFrame ref = frame;
QAVFrame ref = d->sourceFrame;
QMutexLocker locker(&d->graphMutex);
int ret = av_buffersrc_add_frame_flags(filter.ctx(), ref.frame(), AV_BUFFERSRC_FLAG_PUSH);
if (ret < 0)
Expand Down