From 7766f0e8d7fa97a78b0f0c3789eb89e82377ef9b Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Thu, 12 May 2016 17:56:51 +0530 Subject: [PATCH] rtp: Don't use cookie for SSRC Publishing the cookie on multicast seems to be a bad idea. Signed-off-by: Arun Raghavan --- 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 79e712d..91305fa 100644 --- a/src/modules/rtp/module-rtp-recv.c +++ b/src/modules/rtp/module-rtp-recv.c @@ -238,9 +238,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 a7a3f77..2089d54 100644 --- a/src/modules/rtp/module-rtp-send.c +++ b/src/modules/rtp/module-rtp-send.c @@ -491,7 +491,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)) < 0) + if (pa_rtp_context_init_send(&u->rtp_context, fd, payload, pa_frame_size(&ss)) < 0) 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 279c455..365c716 100644 --- a/src/modules/rtp/rtp.c +++ b/src/modules/rtp/rtp.c @@ -43,14 +43,14 @@ #include "rtp.h" -int pa_rtp_context_init_send(pa_rtp_context *c, int fd, uint32_t ssrc, uint8_t payload, size_t frame_size) { +int 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 7c7ae44..5bdb8b9 100644 --- a/src/modules/rtp/rtp.h +++ b/src/modules/rtp/rtp.h @@ -39,7 +39,7 @@ typedef struct pa_rtp_context { pa_memchunk memchunk; } pa_rtp_context; -int pa_rtp_context_init_send(pa_rtp_context *c, int fd, uint32_t ssrc, uint8_t payload, size_t frame_size); +int 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.7.4