[polypaudio-commits] r730 - /trunk/src/modules/rtp/module-rtp-recv.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Sun Apr 16 05:44:43 PDT 2006
Author: lennart
Date: Sun Apr 16 14:44:43 2006
New Revision: 730
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=730&root=polypaudio&view=rev
Log:
limit number of concurrent RTP streams
Modified:
trunk/src/modules/rtp/module-rtp-recv.c
Modified: trunk/src/modules/rtp/module-rtp-recv.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/rtp/module-rtp-recv.c?rev=730&root=polypaudio&r1=729&r2=730&view=diff
==============================================================================
--- trunk/src/modules/rtp/module-rtp-recv.c (original)
+++ trunk/src/modules/rtp/module-rtp-recv.c Sun Apr 16 14:44:43 2006
@@ -97,6 +97,8 @@
pa_hashmap *by_origin;
char *sink_name;
+
+ int n_sessions;
};
static void session_free(struct session *s, int from_hash);
@@ -261,6 +263,11 @@
int fd = -1;
pa_memblock *silence;
+ if (u->n_sessions >= MAX_SESSIONS) {
+ pa_log(__FILE__": session limit reached.");
+ goto fail;
+ }
+
if (!(sink = pa_namereg_get(u->core, u->sink_name, PA_NAMEREG_SINK, 1))) {
pa_log(__FILE__": sink does not exist.");
goto fail;
@@ -323,6 +330,8 @@
pa_rtp_context_init_recv(&s->rtp_context, fd, pa_frame_size(&s->sdp_info.sample_spec));
pa_log_info(__FILE__": Found new session '%s'", s->sdp_info.session_name);
+
+ u->n_sessions++;
return s;
@@ -354,6 +363,9 @@
pa_memblockq_free(s->memblockq);
pa_sdp_info_destroy(&s->sdp_info);
pa_rtp_context_destroy(&s->rtp_context);
+
+ assert(s->userdata->n_sessions >= 1);
+ s->userdata->n_sessions--;
pa_xfree(s);
}
More information about the pulseaudio-commits
mailing list