From 069899c27a0065d08b3ae74be9ffd64e41ceb51e Mon Sep 17 00:00:00 2001 From: prlanzarin Date: Thu, 20 Dec 2018 02:51:37 +0000 Subject: [PATCH] Improved keyframe interval g_timeout dealloc --- src/gst-plugins/commons/kmselement.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gst-plugins/commons/kmselement.c b/src/gst-plugins/commons/kmselement.c index 085b13984..5748558af 100644 --- a/src/gst-plugins/commons/kmselement.c +++ b/src/gst-plugins/commons/kmselement.c @@ -35,6 +35,7 @@ #define MIN_BITRATE "min-bitrate" #define CODEC_CONFIG "codec-config" #define KEYFRAME_INTERVAL "keyframe-interval" +#define DEFAULT_KEYFRAME_TIMEOUT_TAG 0 #define DEFAULT_MIN_BITRATE 0 #define DEFAULT_MAX_BITRATE G_MAXINT @@ -1417,7 +1418,9 @@ kms_element_finalize (GObject * object) g_hash_table_unref (element->priv->pendingpads); g_hash_table_unref (element->priv->output_elements); g_hash_table_unref (element->priv->stats.avg_iss); - g_source_remove (element->priv->keyframe_interval_timeout_tag); + if (element->priv->keyframe_interval_timeout_tag > 0) { + g_source_remove (element->priv->keyframe_interval_timeout_tag); + } g_rec_mutex_clear (&element->mutex); @@ -2011,6 +2014,7 @@ kms_element_init (KmsElement * element) element->priv->min_bitrate = DEFAULT_MIN_BITRATE; element->priv->max_bitrate = DEFAULT_MAX_BITRATE; element->priv->keyframe_interval = DEFAULT_KEYFRAME_INTERVAL; + element->priv->keyframe_interval_timeout_tag = DEFAULT_KEYFRAME_TIMEOUT_TAG; element->priv->pendingpads = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) destroy_pendingpads);