summaryrefslogtreecommitdiff
path: root/telepathy-farsight/stream.c
diff options
context:
space:
mode:
Diffstat (limited to 'telepathy-farsight/stream.c')
-rw-r--r--telepathy-farsight/stream.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/telepathy-farsight/stream.c b/telepathy-farsight/stream.c
index 39e2f0d..7082fc9 100644
--- a/telepathy-farsight/stream.c
+++ b/telepathy-farsight/stream.c
@@ -2868,6 +2868,8 @@ _tf_stream_try_sending_codecs (TfStream *stream)
GPtrArray *tpcodecs = NULL;
GHashTable *feedback_messages = NULL;
GPtrArray *header_extensions = NULL;
+ gboolean sent = FALSE;
+ GList *resend_codecs = NULL;
if (stream->priv->block_ready)
return;
@@ -2916,6 +2918,7 @@ _tf_stream_try_sending_codecs (TfStream *stream)
NULL, (GObject *) stream);
stream->priv->send_local_codecs = FALSE;
stream->priv->ready_called = TRUE;
+ sent = TRUE;
goto out;
}
@@ -2941,6 +2944,7 @@ _tf_stream_try_sending_codecs (TfStream *stream)
-1, tpcodecs, async_method_callback,
"Media.StreamHandler::SupportedCodecs", NULL, (GObject *) stream);
stream->priv->send_supported_codecs = FALSE;
+ sent = TRUE;
/* Fallthrough to potentially call CodecsUpdated as CMs assume
* SupportedCodecs will only give the intersection of the already sent
@@ -2951,8 +2955,12 @@ _tf_stream_try_sending_codecs (TfStream *stream)
/* Only send updates if there was something to update (iotw we sent codecs
* before) or our list changed */
if (stream->priv->last_sent_codecs != NULL
- && !fs_codec_list_are_equal (fscodecs, stream->priv->last_sent_codecs))
+ && (resend_codecs =
+ fs_session_codecs_need_resend (stream->priv->fs_session,
+ stream->priv->last_sent_codecs, fscodecs)) != NULL)
{
+ fs_codec_list_destroy (resend_codecs);
+
if (!tpcodecs)
tpcodecs = fs_codecs_to_tp (stream, fscodecs);
if (!feedback_messages)
@@ -2976,6 +2984,7 @@ _tf_stream_try_sending_codecs (TfStream *stream)
stream->priv->stream_handler_proxy,
-1, tpcodecs, async_method_callback,
"Media.StreamHandler::CodecsUpdated", NULL, (GObject *) stream);
+ sent = TRUE;
}
out:
@@ -2985,8 +2994,11 @@ out:
g_boxed_free (TP_HASH_TYPE_RTCP_FEEDBACK_MESSAGE_MAP, feedback_messages);
if (header_extensions)
g_boxed_free (TP_ARRAY_TYPE_RTP_HEADER_EXTENSIONS_LIST, header_extensions);
- fs_codec_list_destroy (stream->priv->last_sent_codecs);
- stream->priv->last_sent_codecs = fscodecs;
+ if (sent)
+ {
+ fs_codec_list_destroy (stream->priv->last_sent_codecs);
+ stream->priv->last_sent_codecs = fscodecs;
+ }
}
/**