Skip to content
Snippets Groups Projects
Commit a2041a65 authored by Maxym Dmytrychenko's avatar Maxym Dmytrychenko
Browse files

qsvenc: AV_PIX_FMT_QSV path should release frame

Fixes high memory usage and prevents over allocation of the frames via
proper unref.

Can be checked as:
-hwaccel qsv -c:v h264_qsv -i ../h264-conformance/CANL2_Sony_E.jsv -c:v
h264_qsv -b:v 2000k -y qsv.mp4
parent 2a9e1c12
No related branches found
No related tags found
No related merge requests found
...@@ -1028,6 +1028,9 @@ static void clear_unused_frames(QSVEncContext *q) ...@@ -1028,6 +1028,9 @@ static void clear_unused_frames(QSVEncContext *q)
QSVFrame *cur = q->work_frames; QSVFrame *cur = q->work_frames;
while (cur) { while (cur) {
if (cur->used && !cur->surface.Data.Locked) { if (cur->used && !cur->surface.Data.Locked) {
if (cur->frame->format == AV_PIX_FMT_QSV) {
av_frame_unref(cur->frame);
}
cur->used = 0; cur->used = 0;
} }
cur = cur->next; cur = cur->next;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment