summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2011-06-01 15:59:47 (GMT)
committerOlivier CrĂȘte <olivier.crete@collabora.com>2011-06-10 20:22:16 (GMT)
commit59f2253a09437073f7c39c4deeb1693019389461 (patch)
tree1c39cdc7d04ebd6188d2ad3e44043734dbffcca2
parentbccd0101e057160105b7b7807466159da27714b8 (diff)
downloadtelepathy-farsight-59f2253a09437073f7c39c4deeb1693019389461.tar.gz
telepathy-farsight-59f2253a09437073f7c39c4deeb1693019389461.tar.xz
Only call CodecsUpdated() when config params have changed and the other side should be notified
Also require farsight2 0.0.29 for the new comparison function
-rw-r--r--configure.ac2
-rw-r--r--telepathy-farsight/stream.c18
2 files changed, 16 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 432a88b..f934069 100644
--- a/configure.ac
+++ b/configure.ac
@@ -104,7 +104,7 @@ AC_SUBST(TELEPATHY_CFLAGS)
AC_SUBST(TELEPATHY_LIBS)
dnl Check for farsight
-PKG_CHECK_MODULES(FARSIGHT2, [farsight2-0.10 >= 0.0.28])
+PKG_CHECK_MODULES(FARSIGHT2, [farsight2-0.10 >= 0.0.29])
AC_SUBST(FARSIGHT2_CFLAGS)
AC_SUBST(FARSIGHT2_LIBS)
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;
+ }
}
/**