ffmpeg/avframe-queue: Unreference frames that may have a ref-counted obj

This commit is contained in:
Michael Fabian 'Xaymar' Dirks
2019-07-24 21:22:35 +02:00
parent 24bc913f53
commit 97a68404c0
+4 -2
View File
@@ -24,8 +24,10 @@
std::shared_ptr<AVFrame> ffmpeg::avframe_queue::create_frame() std::shared_ptr<AVFrame> ffmpeg::avframe_queue::create_frame()
{ {
std::shared_ptr<AVFrame> frame = std::shared_ptr<AVFrame> frame = std::shared_ptr<AVFrame>(av_frame_alloc(), [](AVFrame* frame) {
std::shared_ptr<AVFrame>(av_frame_alloc(), [](AVFrame* frame) { av_frame_free(&frame); }); av_frame_unref(frame);
av_frame_free(&frame);
});
frame->width = this->resolution.first; frame->width = this->resolution.first;
frame->height = this->resolution.second; frame->height = this->resolution.second;
frame->format = this->format; frame->format = this->format;