]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
transcoding: fix the memory leak for libx264
authorJaroslav Kysela <perex@perex.cz>
Fri, 5 Jan 2018 09:12:50 +0000 (10:12 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 5 Jan 2018 09:12:50 +0000 (10:12 +0100)
src/transcoding/codec/codecs/libs/libx26x.c

index 8506e22267108e5adec98850d5c693db0ce88855..088b11e70dc3fa10071f3e0318e77d8bdb6868b7 100644 (file)
@@ -98,6 +98,17 @@ static const codec_profile_class_t codec_profile_libx26x_class = {
 };
 
 
+static void
+tvh_codec_profile_libx265_destroy(TVHCodecProfile *_self)
+{
+    tvh_codec_profile_libx26x_t *self = (tvh_codec_profile_libx26x_t *)_self;
+    tvh_codec_profile_video_destroy(_self);
+    free(self->preset);
+    free(self->tune);
+    free(self->params);
+}
+
+
 /* libx264 ================================================================== */
 
 #if ENABLE_LIBX264
@@ -201,6 +212,7 @@ TVHVideoCodec tvh_codec_libx264 = {
     .size     = sizeof(tvh_codec_profile_libx26x_t),
     .idclass  = &codec_profile_libx264_class,
     .profiles = libx264_profiles,
+    .profile_destroy = tvh_codec_profile_libx265_destroy,
 };
 
 #endif
@@ -294,17 +306,6 @@ static const codec_profile_class_t codec_profile_libx265_class = {
 };
 
 
-static void
-tvh_codec_profile_libx265_destroy(TVHCodecProfile *_self)
-{
-    tvh_codec_profile_libx26x_t *self = (tvh_codec_profile_libx26x_t *)_self;
-    tvh_codec_profile_video_destroy(_self);
-    free(self->preset);
-    free(self->tune);
-    free(self->params);
-}
-
-
 TVHVideoCodec tvh_codec_libx265 = {
     .name    = "libx265",
     .size    = sizeof(tvh_codec_profile_libx26x_t),