aboutsummaryrefslogtreecommitdiffstats
path: root/ffserver.c
diff options
context:
space:
mode:
authorReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>2014-12-26 18:03:25 -0300
committerReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>2014-12-26 18:12:39 -0300
commit719cc025869b59bbdc438ffe2236a0c7e0062d17 (patch)
tree47e22f1eeb1bf38171ad63c36296e5eae63572ac /ffserver.c
parent18011888cc8791ab6c3d1a3563ff62a834f77a92 (diff)
downloadffmpeg-719cc025869b59bbdc438ffe2236a0c7e0062d17.tar.gz
ffserver: reflow start_multicast()
Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Diffstat (limited to 'ffserver.c')
-rw-r--r--ffserver.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/ffserver.c b/ffserver.c
index 94d315f994..0094d2831c 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -489,12 +489,14 @@ static void start_multicast(void)
HTTPContext *rtp_c;
struct sockaddr_in dest_addr = {0};
int default_port, stream_index;
+ unsigned int random0, random1;
default_port = 6000;
for(stream = config.first_stream; stream; stream = stream->next) {
- if (stream->is_multicast) {
- unsigned random0 = av_lfg_get(&random_state);
- unsigned random1 = av_lfg_get(&random_state);
+ if (!stream->is_multicast)
+ continue;
+ random0 = av_lfg_get(&random_state);
+ random1 = av_lfg_get(&random_state);
/* open the RTP connection */
snprintf(session_id, sizeof(session_id), "%08x%08x",
random0, random1);
@@ -525,15 +527,16 @@ static void start_multicast(void)
stream_index++) {
dest_addr.sin_port = htons(stream->multicast_port +
2 * stream_index);
- if (rtp_new_av_stream(rtp_c, stream_index, &dest_addr, NULL) < 0) {
+ if (rtp_new_av_stream(rtp_c, stream_index, &dest_addr, NULL)
+ >= 0) {
+ continue;
+ }
http_log("Could not open output stream '%s/streamid=%d'\n",
stream->filename, stream_index);
exit(1);
- }
}
rtp_c->state = HTTPSTATE_SEND_DATA;
- }
}
}