lavc/videotoolbox: CFRelease() session
authorClément Bœsch <clement@stupeflix.com>
Fri, 17 Jun 2016 13:51:08 +0000 (15:51 +0200)
committerClément Bœsch <clement@stupeflix.com>
Fri, 17 Jun 2016 15:46:19 +0000 (17:46 +0200)
"When you are done with a decompression session you created, call
VTDecompressionSessionInvalidate to tear it down and then CFRelease to
release your object reference."

libavcodec/videotoolbox.c

index 384bb8a598209787a9fcb440bff24062ca41a0ed..7f726120cd6750bc01a5c44572cdb2dbe3b0d087 100644 (file)
@@ -628,8 +628,10 @@ static void videotoolbox_default_free(AVCodecContext *avctx)
         if (videotoolbox->cm_fmt_desc)
             CFRelease(videotoolbox->cm_fmt_desc);
 
-        if (videotoolbox->session)
+        if (videotoolbox->session) {
             VTDecompressionSessionInvalidate(videotoolbox->session);
+            CFRelease(videotoolbox->session);
+        }
     }
 }