[FFmpeg-cvslog] ffserver: unify exit path in http_server()
Reynaldo H. Verdejo Pinochet
git at videolan.org
Sat Sep 12 03:44:32 CEST 2015
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet <reynaldo at osg.samsung.com> | Fri Sep 11 15:05:48 2015 -0700| [2580395e1cd27c643bd95712c88ba7c0358c44ac] | committer: Reynaldo H. Verdejo Pinochet
ffserver: unify exit path in http_server()
Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo at osg.samsung.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2580395e1cd27c643bd95712c88ba7c0358c44ac
---
ffserver.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/ffserver.c b/ffserver.c
index 2a5bc92..d4b25f2 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -566,25 +566,21 @@ static int http_server(void)
if (config.http_addr.sin_port) {
server_fd = socket_open_listen(&config.http_addr);
- if (server_fd < 0) {
- av_free(poll_table);
- return -1;
- }
+ if (server_fd < 0)
+ goto quit;
}
if (config.rtsp_addr.sin_port) {
rtsp_server_fd = socket_open_listen(&config.rtsp_addr);
if (rtsp_server_fd < 0) {
- av_free(poll_table);
closesocket(server_fd);
- return -1;
+ goto quit;
}
}
if (!rtsp_server_fd && !server_fd) {
http_log("HTTP and RTSP disabled.\n");
- av_free(poll_table);
- return -1;
+ goto quit;
}
http_log("FFserver started.\n");
@@ -662,8 +658,7 @@ static int http_server(void)
ret = poll(poll_table, poll_entry - poll_table, delay);
if (ret < 0 && ff_neterrno() != AVERROR(EAGAIN) &&
ff_neterrno() != AVERROR(EINTR)) {
- av_free(poll_table);
- return -1;
+ goto quit;
}
} while (ret < 0);
@@ -697,6 +692,10 @@ static int http_server(void)
new_connection(rtsp_server_fd, 1);
}
}
+
+quit:
+ av_free(poll_table);
+ return -1;
}
/* start waiting for a new HTTP/RTSP request */
More information about the ffmpeg-cvslog
mailing list