[pulseaudio-discuss] [PATCH 2/8] rtp: Don't use cookie for SSRC

arun at accosted.net arun at accosted.net
Mon Feb 29 10:16:30 UTC 2016


From: Arun Raghavan <git at arunraghavan.net>

Publishing the cookie on multicast seems to be a bad idea.
---
 src/modules/rtp/module-rtp-recv.c | 3 ---
 src/modules/rtp/module-rtp-send.c | 2 +-
 src/modules/rtp/rtp.c             | 4 ++--
 src/modules/rtp/rtp.h             | 2 +-
 4 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/modules/rtp/module-rtp-recv.c b/src/modules/rtp/module-rtp-recv.c
index 528b6d8..640f672 100644
--- a/src/modules/rtp/module-rtp-recv.c
+++ b/src/modules/rtp/module-rtp-recv.c
@@ -240,9 +240,6 @@ static int rtpoll_work_cb(pa_rtpoll_item *i) {
 
         s->ssrc = s->rtp_context.ssrc;
         s->offset = s->rtp_context.timestamp;
-
-        if (s->ssrc == s->userdata->module->core->cookie)
-            pa_log_warn("Detected RTP packet loop!");
     } else {
         if (s->ssrc != s->rtp_context.ssrc) {
             pa_memblock_unref(chunk.memblock);
diff --git a/src/modules/rtp/module-rtp-send.c b/src/modules/rtp/module-rtp-send.c
index 22a5f44..1c1ebea 100644
--- a/src/modules/rtp/module-rtp-send.c
+++ b/src/modules/rtp/module-rtp-send.c
@@ -489,7 +489,7 @@ int pa__init(pa_module*m) {
 
     pa_xfree(n);
 
-    if (!pa_rtp_context_init_send(&u->rtp_context, fd, m->core->cookie, payload, pa_frame_size(&ss)))
+    if (!pa_rtp_context_init_send(&u->rtp_context, fd, payload, pa_frame_size(&ss)))
         goto fail;
     pa_sap_context_init_send(&u->sap_context, sap_fd, p);
 
diff --git a/src/modules/rtp/rtp.c b/src/modules/rtp/rtp.c
index f188345..dfc295f 100644
--- a/src/modules/rtp/rtp.c
+++ b/src/modules/rtp/rtp.c
@@ -43,14 +43,14 @@
 
 #include "rtp.h"
 
-bool pa_rtp_context_init_send(pa_rtp_context *c, int fd, uint32_t ssrc, uint8_t payload, size_t frame_size) {
+bool pa_rtp_context_init_send(pa_rtp_context *c, int fd, uint8_t payload, size_t frame_size) {
     pa_assert(c);
     pa_assert(fd >= 0);
 
     c->fd = fd;
     c->sequence = (uint16_t) (rand()*rand());
     c->timestamp = 0;
-    c->ssrc = ssrc ? ssrc : (uint32_t) (rand()*rand());
+    c->ssrc = (uint32_t) (rand()*rand());
     c->payload = (uint8_t) (payload & 127U);
     c->frame_size = frame_size;
 
diff --git a/src/modules/rtp/rtp.h b/src/modules/rtp/rtp.h
index 61f23cf..57be3e4 100644
--- a/src/modules/rtp/rtp.h
+++ b/src/modules/rtp/rtp.h
@@ -37,7 +37,7 @@ typedef struct pa_rtp_context {
     pa_memchunk memchunk;
 } pa_rtp_context;
 
-bool pa_rtp_context_init_send(pa_rtp_context *c, int fd, uint32_t ssrc, uint8_t payload, size_t frame_size);
+bool pa_rtp_context_init_send(pa_rtp_context *c, int fd, uint8_t payload, size_t frame_size);
 
 /* If the memblockq doesn't have a silence memchunk set, then the caller must
  * guarantee that the current read index doesn't point to a hole. */
-- 
2.5.0



More information about the pulseaudio-discuss mailing list