Merge commit 'a2041a6522642859ce64af1c618d6fb90a50d4af'
authorJames Almer <jamrial@gmail.com>
Tue, 18 Sep 2018 16:28:05 +0000 (13:28 -0300)
committerJames Almer <jamrial@gmail.com>
Tue, 18 Sep 2018 16:28:05 +0000 (13:28 -0300)
* commit 'a2041a6522642859ce64af1c618d6fb90a50d4af':
  qsvenc: AV_PIX_FMT_QSV path should release frame

Merged-by: James Almer <jamrial@gmail.com>
libavcodec/qsvenc.c

index 029e8f3..948751d 100644 (file)
@@ -1026,6 +1026,9 @@ static void clear_unused_frames(QSVEncContext *q)
     while (cur) {
         if (cur->used && !cur->surface.Data.Locked) {
             free_encoder_ctrl_payloads(&cur->enc_ctrl);
+            if (cur->frame->format == AV_PIX_FMT_QSV) {
+                av_frame_unref(cur->frame);
+            }
             cur->used = 0;
         }
         cur = cur->next;