Browse Source

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
tags/n4.1
Maxym Dmytrychenko 7 years ago
parent
commit
a2041a6522
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavcodec/qsvenc.c

+ 3
- 0
libavcodec/qsvenc.c View File

@@ -1028,6 +1028,9 @@ static void clear_unused_frames(QSVEncContext *q)
QSVFrame *cur = q->work_frames;
while (cur) {
if (cur->used && !cur->surface.Data.Locked) {
if (cur->frame->format == AV_PIX_FMT_QSV) {
av_frame_unref(cur->frame);
}
cur->used = 0;
}
cur = cur->next;


Loading…
Cancel
Save