mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix: Remove unnecessary calls to av_frame_unref
If we immediately free it, the refcount goes to zero!
This commit is contained in:
parent
9674bff0cf
commit
91414b4fce
|
@ -599,7 +599,9 @@ AVFrame* VideoFrame::generateAVFrame(const QSize& dimensions, const int pixelFor
|
||||||
|
|
||||||
if (!swsCtx) {
|
if (!swsCtx) {
|
||||||
av_freep(&ret->data[0]);
|
av_freep(&ret->data[0]);
|
||||||
|
#if LIBAVCODEC_VERSION_INT < 3747941
|
||||||
av_frame_unref(ret);
|
av_frame_unref(ret);
|
||||||
|
#endif
|
||||||
av_frame_free(&ret);
|
av_frame_free(&ret);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -645,7 +647,9 @@ AVFrame* VideoFrame::storeAVFrame(AVFrame* frame, const QSize& dimensions, const
|
||||||
|
|
||||||
// Free new frame
|
// Free new frame
|
||||||
av_freep(&frame->data[0]);
|
av_freep(&frame->data[0]);
|
||||||
|
#if LIBAVCODEC_VERSION_INT < 3747941
|
||||||
av_frame_unref(frame);
|
av_frame_unref(frame);
|
||||||
|
#endif
|
||||||
av_frame_free(&frame);
|
av_frame_free(&frame);
|
||||||
|
|
||||||
return old_ret;
|
return old_ret;
|
||||||
|
@ -676,11 +680,15 @@ void VideoFrame::deleteFrameBuffer()
|
||||||
if (freeSourceFrame) {
|
if (freeSourceFrame) {
|
||||||
av_freep(&frame->data[0]);
|
av_freep(&frame->data[0]);
|
||||||
}
|
}
|
||||||
|
#if LIBAVCODEC_VERSION_INT < 3747941
|
||||||
av_frame_unref(frame);
|
av_frame_unref(frame);
|
||||||
|
#endif
|
||||||
av_frame_free(&frame);
|
av_frame_free(&frame);
|
||||||
} else {
|
} else {
|
||||||
av_freep(&frame->data[0]);
|
av_freep(&frame->data[0]);
|
||||||
|
#if LIBAVCODEC_VERSION_INT < 3747941
|
||||||
av_frame_unref(frame);
|
av_frame_unref(frame);
|
||||||
|
#endif
|
||||||
av_frame_free(&frame);
|
av_frame_free(&frame);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user