[farsight2/master] rtpcodecnego: Verify if there are any valid local codecs left after applying preferences

Olivier Crête olivier.crete at collabora.co.uk
Mon Oct 26 05:42:06 PDT 2009


---
 gst/fsrtpconference/fs-rtp-codec-negotiation.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/gst/fsrtpconference/fs-rtp-codec-negotiation.c b/gst/fsrtpconference/fs-rtp-codec-negotiation.c
index b9838e1..d202ef4 100644
--- a/gst/fsrtpconference/fs-rtp-codec-negotiation.c
+++ b/gst/fsrtpconference/fs-rtp-codec-negotiation.c
@@ -539,6 +539,7 @@ create_local_codec_associations (
   GList *bp_e = NULL;
   GList *codec_pref_e = NULL;
   GList *lca_e = NULL;
+  gboolean has_valid_codec = FALSE;
 
   if (blueprints == NULL)
     return NULL;
@@ -792,8 +793,16 @@ create_local_codec_associations (
       ca->need_config = FALSE;
     else
       ca->need_config = codec_needs_config (ca->codec);
+
+    if (codec_association_is_valid_for_sending (ca, TRUE))
+      has_valid_codec = TRUE;
   }
 
+  if (!has_valid_codec)
+  {
+    GST_WARNING ("All codecs disabled by preferences");
+    goto error;
+  }
 
   return codec_associations;
 
-- 
1.5.6.5




More information about the farsight-commits mailing list