[farsight2/master] Reject list of codec associations without valid codecs

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:22:43 PST 2008


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

diff --git a/gst/fsrtpconference/fs-rtp-codec-negotiation.c b/gst/fsrtpconference/fs-rtp-codec-negotiation.c
index af571f4..eaa355c 100644
--- a/gst/fsrtpconference/fs-rtp-codec-negotiation.c
+++ b/gst/fsrtpconference/fs-rtp-codec-negotiation.c
@@ -519,6 +519,7 @@ negotiate_stream_codecs (const GList *remote_codecs,
 {
   GList *new_codec_associations = NULL;
   const GList *rcodec_e = NULL;
+  GList *item = NULL;
 
   for (rcodec_e = remote_codecs;
        rcodec_e;
@@ -586,8 +587,23 @@ negotiate_stream_codecs (const GList *remote_codecs,
     }
   }
 
+  /*
+   * Check if there is a non-disabled codec left
+   */
+  for (item = new_codec_associations;
+       item;
+       item = g_list_next (item))
+  {
+    CodecAssociation *ca = item->data;
 
-  return new_codec_associations;
+    if (!ca->disable && !ca->reserved && !ca->recv_only)
+      return new_codec_associations;
+  }
+
+  /* Else we destroy when and return NULL.. ie .. an error */
+  codec_association_list_destroy (new_codec_associations);
+
+  return NULL;
 }
 
 /**
-- 
1.5.6.5




More information about the farsight-commits mailing list