From f3a6c15e6a8befe2ee9b7f4942aaa5020a1a9b38 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Mon, 28 Feb 2022 09:47:00 +0100 Subject: [PATCH] sip: media-pipeline: Allow new pipeline without codec set --- plugins/sip/calls-sip-media-pipeline.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/plugins/sip/calls-sip-media-pipeline.c b/plugins/sip/calls-sip-media-pipeline.c index 84af9fa..285b4c4 100644 --- a/plugins/sip/calls-sip-media-pipeline.c +++ b/plugins/sip/calls-sip-media-pipeline.c @@ -784,10 +784,12 @@ calls_sip_media_pipeline_new (MediaCodecInfo *codec) pipeline = g_initable_new (CALLS_TYPE_SIP_MEDIA_PIPELINE, NULL, &error, NULL); - if (pipeline) - g_object_set (pipeline, "codec", codec, NULL); - else + if (pipeline) { + if (codec) + g_object_set (pipeline, "codec", codec, NULL); + } else { g_warning ("Media pipeline could not be initialized: %s", error->message); + } return pipeline; } @@ -901,6 +903,11 @@ calls_sip_media_pipeline_start (CallsSipMediaPipeline *self) GSocket *socket; g_return_if_fail (CALLS_IS_SIP_MEDIA_PIPELINE (self)); + if (!self->codec) { + g_warning ("Codec not set for this pipeline. Cannot start"); + return; + } + g_debug ("Starting media pipeline"); self->is_running = TRUE;