[FFmpeg-cvslog] ffserver: prefer av_asprintf over malloc+snprintf for Launch setting.

Clément Bœsch git at videolan.org
Wed Nov 14 10:10:25 CET 2012


ffmpeg | branch: master | Clément Bœsch <clement.boesch at smartjog.com> | Wed Nov 14 10:36:23 2012 +0200| [a9ba9268d7f7539621ddc94ef06b2f654d30a35e] | committer: Clément Bœsch

ffserver: prefer av_asprintf over malloc+snprintf for Launch setting.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a9ba9268d7f7539621ddc94ef06b2f654d30a35e
---

 ffserver.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index d224b41..599f9be 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -4208,10 +4208,7 @@ static int parse_ffconfig(const char *filename)
                     feed->child_argv[i] = av_strdup(arg);
                 }
 
-                feed->child_argv[i] = av_malloc(30 + strlen(feed->filename));
-
-                snprintf(feed->child_argv[i], 30+strlen(feed->filename),
-                    "http://%s:%d/%s",
+                feed->child_argv[i] = av_asprintf("http://%s:%d/%s",
                         (my_http_addr.sin_addr.s_addr == INADDR_ANY) ? "127.0.0.1" :
                     inet_ntoa(my_http_addr.sin_addr),
                     ntohs(my_http_addr.sin_port), feed->filename);



More information about the ffmpeg-cvslog mailing list