[FFmpeg-cvslog] ffserver: fix broken HTML on generated status page

2016-11-30 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Wed Nov 30 10:28:16 2016 -0800| 
[b5c899ab5ec8ff89daf4d034f257dd0892625400] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: fix broken HTML on generated status page

Dropped incompatible/obsoleted HTML tag attributes

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver.c| 27 +--
 tests/ffserver.regression.ref |  2 +-
 2 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index d6b7b44..4e5ce1f 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -1885,8 +1885,8 @@ static inline void print_stream_params(AVIOContext *pb, 
FFServerStream *stream)
 
 stream_no = stream->nb_streams;
 
-avio_printf(pb, "Stream"
-"typekbit/scodec"
+avio_printf(pb, "Stream"
+"typekbit/scodec"
 "Parameters\n");
 
 for (i = 0; i < stream_no; i++) {
@@ -1912,7 +1912,7 @@ static inline void print_stream_params(AVIOContext *pb, 
FFServerStream *stream)
 abort();
 }
 
-avio_printf(pb, "%d%s%"PRId64
+avio_printf(pb, "%d%s%"PRId64
 "%s%s\n",
 i, type, (int64_t)st->codecpar->bit_rate/1000,
 codec ? codec->name : "", parameters);
@@ -1979,8 +1979,8 @@ static void compute_status(HTTPContext *c)
 avio_printf(pb, "%s Status\n", program_name);
 /* format status */
 avio_printf(pb, "Available Streams\n");
-avio_printf(pb, "\n");
-avio_printf(pb, "PathServedConnsbytesFormatBit 
ratekbit/sVideokbit/sCodecAudiokbit/sCodecFeed\n");
+avio_printf(pb, "\n");
+avio_printf(pb, 
"PathServedConnsbytesFormatBit 
ratekbit/sVideokbit/sCodecAudiokbit/sCodecFeed\n");
 stream = config.first_stream;
 while (stream) {
 char sfilename[1024];
@@ -2014,7 +2014,7 @@ static void compute_status(HTTPContext *c)
 
 avio_printf(pb, "%s ",
 sfilename, stream->filename);
-avio_printf(pb, " %d  ",
+avio_printf(pb, " %d  ",
 stream->conns_served);
 // TODO: Investigate if we can make http bitexact so it always 
produces the same count of bytes
 if (!config.bitexact)
@@ -2058,8 +2058,7 @@ static void compute_status(HTTPContext *c)
 }
 }
 
-avio_printf(pb, " %s  %d "
-" %d  %s %s  "
+avio_printf(pb, " %s  %d  %d  %s %s  "
 "%d  %s %s",
 stream->fmt->name, stream->bandwidth,
 video_bit_rate / 1000, video_codec_name,
@@ -2074,8 +2073,8 @@ static void compute_status(HTTPContext *c)
 }
 break;
 default:
-avio_printf(pb, " -  - "
-" -  - 
\n");
+avio_printf(pb, " -  - "
+" -  - \n");
 break;
 }
 stream = stream->next;
@@ -2158,16 +2157,16 @@ static void compute_status(HTTPContext *c)
 p = inet_ntoa(c1->from_addr.sin_addr);
 clean_html(c1->clean_url, sizeof(c1->clean_url), c1->url);
 avio_printf(pb, "%d%s%s%s%s%s%s"
-"",
+"",
 i, c1->stream ? c1->stream->filename : "",
 c1->state == HTTPSTATE_RECEIVE_DATA ? "(input)" : "",
 p,
 c1->clean_url,
 c1->protocol, http_state[c1->state]);
 fmt_bytecount(pb, bitrate);
-avio_printf(pb, "");
+avio_printf(pb, "");
 fmt_bytecount(pb, compute_datarate(>datarate, c1->data_count) * 8);
-avio_printf(pb, "");
+avio_printf(pb, "");
 fmt_bytecount(pb, c1->data_count);
 avio_printf(pb, "\n");
 c1 = c1->next;
@@ -2178,7 +2177,7 @@ static void compute_status(HTTPContext *c)
 /* date */
 ti = time(NULL);
 p = ctime();
-avio_printf(pb, "Generated at %s", p);
+avio_printf(pb, "Generated at %s", p);
 }
 avio_printf(pb, "\n\n");
 
diff --git a/tests/ffserver.regression.ref b/tests/ffserver.regression.ref
index 3fdb6d6..3106f85 100644
--- a/tests/ffserver.regression.ref
+++ b/tests/ffserver.regression.ref
@@ -8,4 +8,4 @@ dc16f607e13328a832e73801cd21ec98 *ff-test_h.asf
 4c887dfc1dd0f6ea1a3a2be6dd32e495 *ff-test.jpg
 1d04b73b04aad27793cc762d5afabac1 *ff-test_small.jpg
 bc36c40ee34ebee6ffe50f3094aab733 *ff-test.mjpg
-128530a16464be60d27d013c30401851 *ff-stat
+fd038af80560e15271ce42651093ee43 *ff-stat

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: use .codecpar instead of .codec in print_stream_params()

2016-11-08 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Tue Nov  8 00:49:43 2016 -0800| 
[689f648a9596fc1a47a719b20d7e9d67eb388d73] | committer: Michael Niedermayer

ffserver: use .codecpar instead of .codec in print_stream_params()

AVStream.codec is deprecated

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

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

 ffserver.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index bbeca35..ed8cb2f 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -1880,21 +1880,21 @@ static inline void print_stream_params(AVIOContext *pb, 
FFServerStream *stream)
 
 for (i = 0; i < stream_no; i++) {
 st = stream->streams[i];
-codec = avcodec_find_encoder(st->codec->codec_id);
+codec = avcodec_find_encoder(st->codecpar->codec_id);
 
 parameters[0] = 0;
 
-switch(st->codec->codec_type) {
+switch(st->codecpar->codec_type) {
 case AVMEDIA_TYPE_AUDIO:
 type = "audio";
 snprintf(parameters, sizeof(parameters), "%d channel(s), %d Hz",
- st->codec->channels, st->codec->sample_rate);
+ st->codecpar->channels, st->codecpar->sample_rate);
 break;
 case AVMEDIA_TYPE_VIDEO:
 type = "video";
 snprintf(parameters, sizeof(parameters),
- "%dx%d, q=%d-%d, fps=%d", st->codec->width,
- st->codec->height, st->codec->qmin, st->codec->qmax,
+ "%dx%d, q=%d-%d, fps=%d", st->codecpar->width,
+ st->codecpar->height, st->codec->qmin, st->codec->qmax,
  st->codec->time_base.den / st->codec->time_base.num);
 break;
 default:

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: use AVStream.codecpar in open_input_stream()

2016-11-08 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Tue Nov  8 01:34:58 2016 -0800| 
[6f0a1710d77dde0d803861506a2157a23f08c14c] | committer: Michael Niedermayer

ffserver: use AVStream.codecpar in open_input_stream()

AVStream.codec is deprecated

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

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

 ffserver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffserver.c b/ffserver.c
index 01f311d..3007e2d 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2213,7 +2213,7 @@ static int open_input_stream(HTTPContext *c, const char 
*info)
 c->pts_stream_index = 0;
 for(i=0;istream->nb_streams;i++) {
 if (c->pts_stream_index == 0 &&
-c->stream->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
+c->stream->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) 
{
 c->pts_stream_index = i;
 }
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: user AVStream.codecpar in compute_status()

2016-11-08 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Tue Nov  8 01:07:14 2016 -0800| 
[822e3e2ddb8a122130047451276cda2b1b5e5e7f] | committer: Michael Niedermayer

ffserver: user AVStream.codecpar in compute_status()

AVStream.codec is deprecated

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

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

 ffserver.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 63c408b..01f311d 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -1990,11 +1990,11 @@ static void compute_status(HTTPContext *c)
 
 for(i=0;inb_streams;i++) {
 AVStream *st = stream->streams[i];
-AVCodec *codec = avcodec_find_encoder(st->codec->codec_id);
+AVCodec *codec = avcodec_find_encoder(st->codecpar->codec_id);
 
-switch(st->codec->codec_type) {
+switch(st->codecpar->codec_type) {
 case AVMEDIA_TYPE_AUDIO:
-audio_bit_rate += st->codec->bit_rate;
+audio_bit_rate += st->codecpar->bit_rate;
 if (codec) {
 if (*audio_codec_name)
 audio_codec_name_extra = "...";
@@ -2002,7 +2002,7 @@ static void compute_status(HTTPContext *c)
 }
 break;
 case AVMEDIA_TYPE_VIDEO:
-video_bit_rate += st->codec->bit_rate;
+video_bit_rate += st->codecpar->bit_rate;
 if (codec) {
 if (*video_codec_name)
 video_codec_name_extra = "...";
@@ -2010,7 +2010,7 @@ static void compute_status(HTTPContext *c)
 }
 break;
 case AVMEDIA_TYPE_DATA:
-video_bit_rate += st->codec->bit_rate;
+video_bit_rate += st->codecpar->bit_rate;
 break;
 default:
 abort();
@@ -2107,9 +2107,9 @@ static void compute_status(HTTPContext *c)
 if (c1->stream) {
 for (j = 0; j < c1->stream->nb_streams; j++) {
 if (!c1->stream->feed)
-bitrate += c1->stream->streams[j]->codec->bit_rate;
+bitrate += c1->stream->streams[j]->codecpar->bit_rate;
 else if (c1->feed_streams[j] >= 0)
-bitrate += 
c1->stream->feed->streams[c1->feed_streams[j]]->codec->bit_rate;
+bitrate += 
c1->stream->feed->streams[c1->feed_streams[j]]->codecpar->bit_rate;
 }
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: get time_base from AVStream in print_stream_params()

2016-11-08 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Tue Nov  8 00:51:28 2016 -0800| 
[1323349befd3f55bef2f9e46168f17a53f8f6d4a] | committer: Michael Niedermayer

ffserver: get time_base from AVStream in print_stream_params()

AVStream.codec is deprecated

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

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

 ffserver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index ed8cb2f..65280d2 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -1895,7 +1895,7 @@ static inline void print_stream_params(AVIOContext *pb, 
FFServerStream *stream)
 snprintf(parameters, sizeof(parameters),
  "%dx%d, q=%d-%d, fps=%d", st->codecpar->width,
  st->codecpar->height, st->codec->qmin, st->codec->qmax,
- st->codec->time_base.den / st->codec->time_base.num);
+ st->time_base.den / st->time_base.num);
 break;
 default:
 abort();
@@ -1903,7 +1903,7 @@ static inline void print_stream_params(AVIOContext *pb, 
FFServerStream *stream)
 
 avio_printf(pb, "%d%s%"PRId64
 "%s%s\n",
-i, type, (int64_t)st->codec->bit_rate/1000,
+i, type, (int64_t)st->codecpar->bit_rate/1000,
 codec ? codec->name : "", parameters);
  }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] configure: add '-uninstalled' to uninstalled .pc files

2016-10-30 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Fri Oct 28 12:48:54 2016 -0700| 
[894e7ef9b4256e92fd0ec9ec2518389502b8be91] | committer: Reynaldo H. Verdejo 
Pinochet

configure: add '-uninstalled' to uninstalled .pc files

pkg-config(1) expects uninstalled pc files to follow the
blah-uninstalled.pc naming convention and the behavior
of the program is impacted by it. Without this fix
overriding PKGP_CONFIG_LIBDIR is required to ensure
uninstalled files are preferred (overkill), instead of
just adding pc-uninstalled/ to the utility's search path
by setting PKG_CONFIG_PATH accordingly.

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index c4122e9..d2ab550 100755
--- a/configure
+++ b/configure
@@ -6816,7 +6816,7 @@ EOF
 mkdir -p doc/examples/pc-uninstalled
 includedir=${source_path}
 [ "$includedir" = . ] && includedir="\${pcfiledir}/../../.."
-cat < doc/examples/pc-uninstalled/$name.pc
+cat < doc/examples/pc-uninstalled/${name}-uninstalled.pc
 prefix=
 exec_prefix=
 libdir=\${pcfiledir}/../../../$name

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avio: add detail to avio_printf() size warning

2015-12-27 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Wed Dec 23 15:05:32 2015 -0800| 
[baf4c489e5f468a208596cd128a6f1c49e6ae35b] | committer: Reynaldo H. Verdejo 
Pinochet

avio: add detail to avio_printf() size warning

Previous "currently size is limited" didn't give away
much in terms of useful info.

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 libavformat/avio.h|2 +-
 libavformat/aviobuf.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/avio.h b/libavformat/avio.h
index abe13b2..c3c0b73 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -458,7 +458,7 @@ attribute_deprecated
 int url_feof(AVIOContext *s);
 #endif
 
-/** @warning currently size is limited */
+/** @warning Writes up to 4 KiB per call */
 int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3);
 
 /**
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index c2aa8dc..57cbf83 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -968,7 +968,7 @@ int avio_closep(AVIOContext **s)
 int avio_printf(AVIOContext *s, const char *fmt, ...)
 {
 va_list ap;
-char buf[4096];
+char buf[4096]; /* update doc entry in avio.h if changed */
 int ret;
 
 va_start(ap, fmt);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: HTML encode msgs instead of blindly stripping chars out

2015-12-27 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Tue Dec 22 00:53:38 2015 -0800| 
[daaa535867274e44d9f8a2a4745343ba66f7200e] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: HTML encode msgs instead of blindly stripping chars out

Fixes weirdness like our "??filename? not found" 404.

None of the chars being used from the previously blacklisted
list needs to be scaped on an UTF-8 document context

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver.c |   89 ++--
 1 file changed, 81 insertions(+), 8 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 0dd3c70..5c07805 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -243,6 +243,8 @@ static int rtp_new_av_stream(HTTPContext *c,
  int stream_index, struct sockaddr_in *dest_addr,
  HTTPContext *rtsp_c);
 /* utils */
+static size_t htmlencode (const char *src, char **dest);
+static inline void cp_html_entity (char *buffer, const char *entity);
 static inline int check_codec_match(AVCodecContext *ccf, AVCodecContext *ccs,
 int stream);
 
@@ -263,12 +265,79 @@ static AVLFG random_state;
 
 static FILE *logfile = NULL;
 
-static void htmlstrip(char *s) {
-while (s && *s) {
-s += strspn(s, 
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,. ");
-if (*s)
-*s++ = '?';
+static inline void cp_html_entity (char *buffer, const char *entity) {
+if (!buffer || !entity)
+return;
+while (*entity)
+*buffer++ = *entity++;
+}
+
+/**
+ * Substitutes known conflicting chars on a text string with
+ * their corresponding HTML entities.
+ *
+ * Returns the number of bytes in the 'encoded' representation
+ * not including the terminating NUL.
+ */
+static size_t htmlencode (const char *src, char **dest) {
+const char *amp = "";
+const char *lt  = "";
+const char *gt  = "";
+const char *start;
+char *tmp;
+size_t final_size = 0;
+
+if (!src)
+return 0;
+
+start = src;
+
+/* Compute needed dest size */
+while (*src != '\0') {
+switch(*src) {
+case 38: /* & */
+final_size += 5;
+break;
+case 60: /* < */
+case 62: /* > */
+final_size += 4;
+break;
+default:
+final_size++;
+}
+src++;
+}
+
+src = start;
+*dest = av_mallocz(final_size + 1);
+if (!*dest)
+return 0;
+
+/* Build dest */
+tmp = *dest;
+while (*src != '\0') {
+switch(*src) {
+case 38: /* & */
+cp_html_entity (tmp, amp);
+tmp += 5;
+break;
+case 60: /* < */
+cp_html_entity (tmp, lt);
+tmp += 4;
+break;
+case 62: /* > */
+cp_html_entity (tmp, gt);
+tmp += 4;
+break;
+default:
+*tmp = *src;
+tmp += 1;
+}
+src++;
 }
+*tmp = '\0';
+
+return final_size;
 }
 
 static int64_t ffm_read_write_index(int fd)
@@ -1356,6 +1425,7 @@ static int http_parse_request(HTTPContext *c)
 char url[1024], *q;
 char protocol[32];
 char msg[1024];
+char *encoded_msg = NULL;
 const char *mime_type;
 FFServerStream *stream;
 int i;
@@ -1753,7 +1823,9 @@ static int http_parse_request(HTTPContext *c)
  send_error:
 c->http_error = 404;
 q = c->buffer;
-htmlstrip(msg);
+if (!htmlencode(msg, _msg)) {
+http_log("Could not encode filename '%s' as HTML\n", msg);
+}
 snprintf(q, c->buffer_size,
   "HTTP/1.0 404 Not Found\r\n"
   "Content-type: text/html\r\n"
@@ -1761,16 +1833,17 @@ static int http_parse_request(HTTPContext *c)
   "\n"
   "\n"
   "\n"
-  "\n"
+  "\n"
   "404 Not Found\n"
   "\n"
   "%s\n"
-  "\n", msg);
+  "\n", encoded_msg? encoded_msg : "File not found");
 q += strlen(q);
 /* prepare output buffer */
 c->buffer_ptr = c->buffer;
 c->buffer_end = q;
 c->state = HTTPSTATE_SEND_HEADER;
+av_freep(_msg);
 return 0;
  send_status:
 compute_status(c);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: make our 404 explicitly HTML5/UTF-8

2015-12-27 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Tue Dec 22 11:28:56 2015 -0800| 
[0e5c1dc9a32b64e1b3c40025c96717b62b40dfc7] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: make our 404 explicitly HTML5/UTF-8

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver.c |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ffserver.c b/ffserver.c
index c7dbb16..0dd3c70 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -1758,8 +1758,12 @@ static int http_parse_request(HTTPContext *c)
   "HTTP/1.0 404 Not Found\r\n"
   "Content-type: text/html\r\n"
   "\r\n"
+  "\n"
   "\n"
-  "404 Not Found\n"
+  "\n"
+  "\n"
+  "404 Not Found\n"
+  "\n"
   "%s\n"
   "\n", msg);
 q += strlen(q);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: add a doctype heading to our HTML pages

2015-12-27 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Tue Dec 22 22:24:40 2015 -0800| 
[b25ac3c999b0b486018279283667129bbad06d08] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: add a doctype heading to our HTML pages

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver.c |4 
 1 file changed, 4 insertions(+)

diff --git a/ffserver.c b/ffserver.c
index 5c07805..889dbd4 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -818,6 +818,7 @@ static void http_send_too_busy_reply(int fd)
"HTTP/1.0 503 Server too busy\r\n"
"Content-type: text/html\r\n"
"\r\n"
+   "\n"
"Too busy\r\n"
"The server is too busy to serve your request at "
"this time.\r\n"
@@ -1527,6 +1528,7 @@ static int http_parse_request(HTTPContext *c)
   "Location: %s\r\n"
   "Content-type: text/html\r\n"
   "\r\n"
+  "\n"
   "Moved\r\n"
   "You should be redirected.\r\n"
   "\r\n",
@@ -1566,6 +1568,7 @@ static int http_parse_request(HTTPContext *c)
   "HTTP/1.0 503 Server too busy\r\n"
   "Content-type: text/html\r\n"
   "\r\n"
+  "\n"
   "Too busy\r\n"
   "The server is too busy to serve your request at "
   "this time.\r\n"
@@ -1931,6 +1934,7 @@ static void compute_status(HTTPContext *c)
 avio_printf(pb, "Pragma: no-cache\r\n");
 avio_printf(pb, "\r\n");
 
+avio_printf(pb, "\n");
 avio_printf(pb, "%s Status\n", program_name);
 if (c->stream->feed_filename[0])
 avio_printf(pb, "\n",

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: unify exit path from build_feed_streams()

2015-12-19 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Tue Dec 15 14:51:18 2015 -0800| 
[532a2833830538925e7830c22a885e73e557d6d7] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: unify exit path from build_feed_streams()

Exit from main on build_feed_streams() failures & use
standard EXIT_ codes on error out/normal exit.

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver.c |   46 +-
 1 file changed, 29 insertions(+), 17 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 129f9fd..8799076 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -3622,7 +3622,7 @@ static void build_file_streams(void)
 }
 
 /* compute the needed AVStream for each feed */
-static void build_feed_streams(void)
+static int build_feed_streams(void)
 {
 FFServerStream *stream, *feed;
 int i;
@@ -3658,7 +3658,7 @@ static void build_feed_streams(void)
 int ret = ffio_set_buf_size(s->pb, FFM_PACKET_SIZE);
 if (ret < 0) {
 http_log("Failed to set buffer size\n");
-exit(1);
+goto bail;
 }
 
 /* Now see if it matches */
@@ -3723,7 +3723,7 @@ static void build_feed_streams(void)
 if (feed->readonly) {
 http_log("Unable to delete feed file '%s' as it is marked 
readonly\n",
 feed->feed_filename);
-exit(1);
+goto bail;
 }
 unlink(feed->feed_filename);
 }
@@ -3733,27 +3733,27 @@ static void build_feed_streams(void)
 
 if (!s) {
 http_log("Failed to allocate context\n");
-exit(1);
+goto bail;
 }
 
 if (feed->readonly) {
 http_log("Unable to create feed file '%s' as it is marked 
readonly\n",
 feed->feed_filename);
-exit(1);
+goto bail;
 }
 
 /* only write the header of the ffm file */
 if (avio_open(>pb, feed->feed_filename, AVIO_FLAG_WRITE) < 0) {
 http_log("Could not open output feed file '%s'\n",
  feed->feed_filename);
-exit(1);
+goto bail;
 }
 s->oformat = feed->fmt;
 s->nb_streams = feed->nb_streams;
 s->streams = feed->streams;
 if (avformat_write_header(s, NULL) < 0) {
 http_log("Container doesn't support the required 
parameters\n");
-exit(1);
+goto bail;
 }
 /* XXX: need better API */
 av_freep(>priv_data);
@@ -3767,7 +3767,7 @@ static void build_feed_streams(void)
 if (fd < 0) {
 http_log("Could not open output feed file '%s'\n",
 feed->feed_filename);
-exit(1);
+goto bail;
 }
 
 feed->feed_write_index = FFMAX(ffm_read_write_index(fd), 
FFM_PACKET_SIZE);
@@ -3778,6 +3778,10 @@ static void build_feed_streams(void)
 
 close(fd);
 }
+return 0;
+
+bail:
+return -1;
 }
 
 /* compute the bandwidth used by each stream */
@@ -3858,7 +3862,9 @@ static const OptionDef options[] = {
 int main(int argc, char **argv)
 {
 struct sigaction sigact = { { 0 } };
-int ret = 0;
+int cfg_parsed;
+int ret = EXIT_FAILURE;
+
 
 config.filename = av_strdup("/etc/ffserver.conf");
 
@@ -3880,13 +3886,11 @@ int main(int argc, char **argv)
 sigact.sa_flags = SA_NOCLDSTOP | SA_RESTART;
 sigaction(SIGCHLD, , 0);
 
-if ((ret = ffserver_parse_ffconfig(config.filename, )) < 0) {
+if ((cfg_parsed = ffserver_parse_ffconfig(config.filename, )) < 0) {
 fprintf(stderr, "Error reading configuration file '%s': %s\n",
-config.filename, av_err2str(ret));
-av_freep();
-exit(1);
+config.filename, av_err2str(cfg_parsed));
+goto bail;
 }
-av_freep();
 
 /* open log file if needed */
 if (config.logfilename[0] != '\0') {
@@ -3899,7 +3903,10 @@ int main(int argc, char **argv)
 
 build_file_streams();
 
-build_feed_streams();
+if (build_feed_streams() < 0) {
+http_log("Could not setup feed streams\n");
+goto bail;
+}
 
 compute_bandwidth();
 
@@ -3908,8 +3915,13 @@ int main(int argc, char **argv)
 
 if (http_server() < 0) {
 http_log("Could not start server\n");
-exit(1);
+goto bail;
 }
 
-return 0;
+ret=EXIT_SUCCESS

[FFmpeg-cvslog] ffserver: refactor build_feed_streams()

2015-12-19 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Wed Dec 16 18:14:25 2015 -0800| 
[ae2ed20b5912b00866631e78049f165deb9f2fb2] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: refactor build_feed_streams()

* Avoid excesive nesting that made it really hard to follow
* Drop unneeded vars
* Factor out codec compatibility check routine
* Ensure inputs are closed and contexts are freed as needed
  before returning

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver.c |  172 ++--
 1 file changed, 98 insertions(+), 74 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 65044e6..c7dbb16 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -242,6 +242,9 @@ static HTTPContext *rtp_new_connection(struct sockaddr_in 
*from_addr,
 static int rtp_new_av_stream(HTTPContext *c,
  int stream_index, struct sockaddr_in *dest_addr,
  HTTPContext *rtsp_c);
+/* utils */
+static inline int check_codec_match(AVCodecContext *ccf, AVCodecContext *ccs,
+int stream);
 
 static const char *my_program_name;
 
@@ -3624,11 +3627,46 @@ static void build_file_streams(void)
 }
 }
 
+static inline
+int check_codec_match(AVCodecContext *ccf, AVCodecContext *ccs, int stream)
+{
+int matches = 1;
+
+#define CHECK_CODEC(x)  (ccf->x != ccs->x)
+if (CHECK_CODEC(codec_id) || CHECK_CODEC(codec_type)) {
+http_log("Codecs do not match for stream %d\n", stream);
+matches = 0;
+} else if (CHECK_CODEC(bit_rate) || CHECK_CODEC(flags)) {
+http_log("Codec bitrates do not match for stream %d\n", stream);
+matches = 0;
+} else if (ccf->codec_type == AVMEDIA_TYPE_VIDEO) {
+if (CHECK_CODEC(time_base.den) ||
+CHECK_CODEC(time_base.num) ||
+CHECK_CODEC(width) ||
+CHECK_CODEC(height)) {
+http_log("Codec width, height or framerate do not match for stream 
%d\n", stream);
+matches = 0;
+}
+} else if (ccf->codec_type == AVMEDIA_TYPE_AUDIO) {
+if (CHECK_CODEC(sample_rate) ||
+CHECK_CODEC(channels) ||
+CHECK_CODEC(frame_size)) {
+http_log("Codec sample_rate, channels, frame_size do not match for 
stream %d\n", stream);
+matches = 0;
+}
+} else {
+http_log("Unknown codec type for stream %d\n", stream);
+matches = 0;
+}
+
+return matches;
+}
+
 /* compute the needed AVStream for each feed */
 static int build_feed_streams(void)
 {
 FFServerStream *stream, *feed;
-int i;
+int i, fd;
 
 /* gather all streams */
 for(stream = config.first_stream; stream; stream = stream->next) {
@@ -3639,98 +3677,77 @@ static int build_feed_streams(void)
 if (stream->is_feed) {
 for(i=0;inb_streams;i++)
 stream->feed_streams[i] = i;
-} else {
-/* we handle a stream coming from a feed */
-for(i=0;inb_streams;i++)
-stream->feed_streams[i] = add_av_stream(feed,
-stream->streams[i]);
+continue;
 }
+/* we handle a stream coming from a feed */
+for(i=0;inb_streams;i++)
+stream->feed_streams[i] = add_av_stream(feed, stream->streams[i]);
 }
 
 /* create feed files if needed */
 for(feed = config.first_feed; feed; feed = feed->next_feed) {
-int fd;
 
 if (avio_check(feed->feed_filename, AVIO_FLAG_READ) > 0) {
-/* See if it matches */
 AVFormatContext *s = NULL;
 int matches = 0;
 
-if (avformat_open_input(, feed->feed_filename, NULL, NULL) >= 0) 
{
-/* set buffer size */
-int ret = ffio_set_buf_size(s->pb, FFM_PACKET_SIZE);
-if (ret < 0) {
-http_log("Failed to set buffer size\n");
-goto bail;
-}
+/* See if it matches */
 
-/* Now see if it matches */
-if (s->nb_streams == feed->nb_streams) {
-matches = 1;
-for(i=0;inb_streams;i++) {
-AVStream *sf, *ss;
-sf = feed->streams[i];
-ss = s->streams[i];
-
-if (sf->index != ss->index ||
-sf->id != ss->id) {
-http_log("Index & Id do not match for stream %d 
(%s)\n",
-   i, feed->feed_filename);
-   

[FFmpeg-cvslog] ffserver: refactor build_file_streams()

2015-12-19 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Tue Dec 15 22:08:52 2015 -0800| 
[4ba148a6ea2c3f2491f1dc60246dd62c665ce1cf] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: refactor build_file_streams()

Avoid unneeded nesting, drop redundant var

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver.c |   85 +++-
 1 file changed, 44 insertions(+), 41 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 8799076..65044e6 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -3567,56 +3567,59 @@ static void extract_mpeg4_header(AVFormatContext 
*infile)
 /* compute the needed AVStream for each file */
 static void build_file_streams(void)
 {
-FFServerStream *stream, *stream_next;
+FFServerStream *stream;
+AVFormatContext *infile;
 int i, ret;
 
 /* gather all streams */
-for(stream = config.first_stream; stream; stream = stream_next) {
-AVFormatContext *infile = NULL;
-stream_next = stream->next;
-if (stream->stream_type == STREAM_TYPE_LIVE &&
-!stream->feed) {
-/* the stream comes from a file */
-/* try to open the file */
-/* open stream */
-if (stream->fmt && !strcmp(stream->fmt->name, "rtp")) {
-/* specific case : if transport stream output to RTP,
- * we use a raw transport stream reader */
-av_dict_set(>in_opts, "mpeg2ts_compute_pcr", "1", 0);
-}
+for(stream = config.first_stream; stream; stream = stream->next) {
+infile = NULL;
 
-if (!stream->feed_filename[0]) {
-http_log("Unspecified feed file for stream '%s'\n",
- stream->filename);
-goto fail;
-}
+if (stream->stream_type != STREAM_TYPE_LIVE || stream->feed)
+continue;
+
+/* the stream comes from a file */
+/* try to open the file */
+/* open stream */
 
-http_log("Opening feed file '%s' for stream '%s'\n",
- stream->feed_filename, stream->filename);
-ret = avformat_open_input(, stream->feed_filename,
-  stream->ifmt, >in_opts);
-if (ret < 0) {
-http_log("Could not open '%s': %s\n", stream->feed_filename,
- av_err2str(ret));
-/* remove stream (no need to spend more time on it) */
-fail:
-remove_stream(stream);
-} else {
-/* find all the AVStreams inside and reference them in
- * 'stream' */
-if (avformat_find_stream_info(infile, NULL) < 0) {
-http_log("Could not find codec parameters from '%s'\n",
- stream->feed_filename);
-avformat_close_input();
-goto fail;
-}
-extract_mpeg4_header(infile);
 
-for(i=0;inb_streams;i++)
-add_av_stream1(stream, infile->streams[i]->codec, 1);
+/* specific case: if transport stream output to RTP,
+ * we use a raw transport stream reader */
+if (stream->fmt && !strcmp(stream->fmt->name, "rtp"))
+av_dict_set(>in_opts, "mpeg2ts_compute_pcr", "1", 0);
 
+if (!stream->feed_filename[0]) {
+http_log("Unspecified feed file for stream '%s'\n",
+ stream->filename);
+goto fail;
+}
+
+http_log("Opening feed file '%s' for stream '%s'\n",
+ stream->feed_filename, stream->filename);
+
+ret = avformat_open_input(, stream->feed_filename,
+  stream->ifmt, >in_opts);
+if (ret < 0) {
+http_log("Could not open '%s': %s\n", stream->feed_filename,
+ av_err2str(ret));
+/* remove stream (no need to spend more time on it) */
+fail:
+remove_stream(stream);
+} else {
+/* find all the AVStreams inside and reference them in
+ * 'stream' */
+if (avformat_find_stream_info(infile, NULL) < 0) {
+http_log("Could not find codec parameters from '%s'\n",
+ stream->feed_filename);
 avformat_close_input();
+goto fail;
 }
+extract_mpeg4_header(infile);
+
+for(i=0;inb_streams;i++)
+add_av_stream1(stream, infile->streams[i]->codec, 1);
+
+avformat_close_input();
 }
 }
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: allocate AVStream's internal too

2015-12-15 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Mon Dec 14 09:49:08 2015 -0800| 
[5a31f2318b8fed1f4711cb86eab6d9b679946878] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: allocate AVStream's internal too

Avoids segfault at init_muxer() (mux.c) due to a
null pointer dereference on the recently
introduced AVStream->internal

Fixes: #5059 (https://trac.ffmpeg.org/ticket/5059)

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/ffserver.c b/ffserver.c
index 029771c..4392a62 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -3423,6 +3423,7 @@ static int rtp_new_av_stream(HTTPContext *c,
 //
 /* ffserver initialization */
 
+/* FIXME: This code should use avformat_new_stream() */
 static AVStream *add_av_stream1(FFServerStream *stream,
 AVCodecContext *codec, int copy)
 {
@@ -3448,6 +3449,7 @@ static AVStream *add_av_stream1(FFServerStream *stream,
 fst->codec = codec;
 
 fst->priv_data = av_mallocz(sizeof(FeedData));
+fst->internal = av_mallocz(sizeof(*fst->internal));
 fst->index = stream->nb_streams;
 avpriv_set_pts_info(fst, 33, 1, 9);
 fst->sample_aspect_ratio = codec->sample_aspect_ratio;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: free pathname before bailing out

2015-12-15 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Mon Dec 14 21:36:11 2015 -0800| 
[dadb95142bd4e8c2b831824e666bbc8b5888f501] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: free pathname before bailing out

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/ffserver.c b/ffserver.c
index 36dc234..fcee874 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -443,6 +443,7 @@ static void start_children(FFServerStream *feed)
 feed->pid = fork();
 if (feed->pid < 0) {
 http_log("Unable to create children: %s\n", strerror(errno));
+av_free (pathname);
 exit(EXIT_FAILURE);
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: use EXIT_FAILURE on failed child fork()

2015-12-15 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Mon Dec 14 21:32:45 2015 -0800| 
[1fa81430ca9746ccce620a26313b3c1f1b698e0d] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: use EXIT_FAILURE on failed child fork()

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffserver.c b/ffserver.c
index 981eece..36dc234 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -443,7 +443,7 @@ static void start_children(FFServerStream *feed)
 feed->pid = fork();
 if (feed->pid < 0) {
 http_log("Unable to create children: %s\n", strerror(errno));
-exit(1);
+exit(EXIT_FAILURE);
 }
 
 if (feed->pid)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: explicitly use time_t for uptime calc

2015-12-15 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Mon Dec 14 23:28:03 2015 -0800| 
[0bdf84b6b0527d30970c5fa555c7bc00a852a3cc] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: explicitly use time_t for uptime calc

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index fcee874..129f9fd 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -3807,7 +3807,8 @@ static void compute_bandwidth(void)
 static void handle_child_exit(int sig)
 {
 pid_t pid;
-int status, uptime;
+int status;
+time_t uptime;
 
 while ((pid = waitpid(-1, , WNOHANG)) > 0) {
 FFServerStream *feed;
@@ -3819,7 +3820,8 @@ static void handle_child_exit(int sig)
 uptime = time(0) - feed->pid_start;
 feed->pid = 0;
 fprintf(stderr,
-"%s: Pid %"PRId64" exited with status %d after %d 
seconds\n",
+"%s: Pid %"PRId64" exited with status %d after %"PRId64" "
+"seconds\n",
 feed->filename, (int64_t) pid, status, uptime);
 
 if (uptime < 30)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: be explicit on failed fork() msg

2015-12-15 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Mon Dec 14 16:10:20 2015 -0800| 
[eb68c35670afbb1f8e8abc010f1e1cae9e4122f7] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: be explicit on failed fork() msg

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffserver.c b/ffserver.c
index 4392a62..981eece 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -442,7 +442,7 @@ static void start_children(FFServerStream *feed)
 
 feed->pid = fork();
 if (feed->pid < 0) {
-http_log("Unable to create children\n");
+http_log("Unable to create children: %s\n", strerror(errno));
 exit(1);
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] libavutil: add version component accessor macros

2015-12-06 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Fri Dec  4 14:07:23 2015 -0800| 
[21c34cb26154a5eadd6e10df86c20e2df3a7bd55] | committer: Reynaldo H. Verdejo 
Pinochet

libavutil: add version component accessor macros

Pretty standard macros, these should help libav*
users avoid repeating ver.si.on parsing code,
which aids in compatibility-checking tasks like
identifying FFmpeg from Libav (_MICRO >= 100 check).
Something many are doing since we are not
intercompatible anymore.

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 libavutil/version.h |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/libavutil/version.h b/libavutil/version.h
index bf0a929..e7f0488 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -37,6 +37,14 @@
 #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
 
 /**
+ * Extract version components from the full ::AV_VERSION_INT int as returned
+ * by functions like ::avformat_version() and ::avcodec_version()
+ */
+#define AV_VERSION_MAJOR(a) ((a) >> 16)
+#define AV_VERSION_MINOR(a) (((a) & 0x00FF00) >> 8)
+#define AV_VERSION_MICRO(a) ((a) & 0xFF)
+
+/**
  * @}
  */
 
@@ -56,7 +64,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  55
-#define LIBAVUTIL_VERSION_MINOR   9
+#define LIBAVUTIL_VERSION_MINOR  10
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] cmdutils: use version accessor macros

2015-12-06 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Sun Dec  6 20:27:40 2015 -0800| 
[21fbc41214b8c61d3627e45c22771ded7943d86d] | committer: Reynaldo H. Verdejo 
Pinochet

cmdutils: use version accessor macros

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 cmdutils.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cmdutils.c b/cmdutils.c
index 41daa95..ceec2d1 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -52,6 +52,7 @@
 #include "libavutil/opt.h"
 #include "libavutil/cpu.h"
 #include "libavutil/ffversion.h"
+#include "libavutil/version.h"
 #include "cmdutils.h"
 #if CONFIG_NETWORK
 #include "libavformat/network.h"
@@ -1058,7 +1059,8 @@ static int warned_cfg = 0;
LIB##LIBNAME##_VERSION_MAJOR,\
LIB##LIBNAME##_VERSION_MINOR,\
LIB##LIBNAME##_VERSION_MICRO,\
-   version >> 16, version >> 8 & 0xff, version & 0xff); \
+   AV_VERSION_MAJOR(version), AV_VERSION_MINOR(version),\
+   AV_VERSION_MICRO(version));  \
 }   \
 if (flags & SHOW_CONFIG) {  \
 const char *cfg = libname##_configuration();\

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: wrap around too-busy message text

2015-10-04 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Sun Oct  4 14:28:01 2015 -0700| 
[8a9089948f023600c1ba70893d5b45fc4b8ecd6c] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: wrap around too-busy message text

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index e3c3b42..34bfa89 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -741,8 +741,10 @@ static void http_send_too_busy_reply(int fd)
"Content-type: text/html\r\n"
"\r\n"
"Too busy\r\n"
-   "The server is too busy to serve your request at 
this time.\r\n"
-   "The number of current connections is %u, and this 
exceeds the limit of %u.\r\n"
+   "The server is too busy to serve your request at "
+   "this time.\r\n"
+   "The number of current connections is %u, and this "
+   "exceeds the limit of %u.\r\n"
"\r\n",
nb_connections, config.nb_max_connections);
 av_assert0(len < sizeof(buffer));

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: fix up rate units in server messages

2015-10-04 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Sun Oct  4 14:45:49 2015 -0700| 
[84b4998dbdbd7fc5a2dac58239cbe0989a6aa4da] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: fix up rate units in server messages

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index a45603a..85c9f1f 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -1491,8 +1491,8 @@ static int http_parse_request(HTTPContext *c)
   "The server is too busy to serve your request at "
   "this time.\r\n"
   "The bandwidth being served (including your stream) "
-  "is %"PRIu64"kbit/sec, and this exceeds the limit of "
-  "%"PRIu64"kbit/sec.\r\n"
+  "is %"PRIu64"kbit/s, and this exceeds the limit of "
+  "%"PRIu64"kbit/s.\r\n"
   "\r\n",
  current_bandwidth, config.max_bandwidth);
 q += strlen(q);
@@ -1789,7 +1789,7 @@ static inline void print_stream_params(AVIOContext *pb, 
FFServerStream *stream)
 stream_no = stream->nb_streams;
 
 avio_printf(pb, "Stream"
-"typekbits/scodec"
+"typekbit/scodec"
 "Parameters\n");
 
 for (i = 0; i < stream_no; i++) {
@@ -1854,7 +1854,7 @@ static void compute_status(HTTPContext *c)
 /* format status */
 avio_printf(pb, "Available Streams\n");
 avio_printf(pb, "\n");
-avio_printf(pb, "PathServedConnsbytesFormatBit 
ratekbits/sVideokbits/sCodecAudiokbits/sCodecFeed\n");
+avio_printf(pb, "PathServedConnsbytesFormatBit 
ratekbit/sVideokbit/sCodecAudiokbit/sCodecFeed\n");
 stream = config.first_stream;
 while (stream) {
 char sfilename[1024];
@@ -2009,7 +2009,7 @@ static void compute_status(HTTPContext *c)
 
 avio_printf(pb, "\n");
 avio_printf(pb, "#FileIPProtoStateTarget "
-"bits/secActual bits/secBytes transferred\n");
+"bit/sActual bit/sBytes transferred\n");
 c1 = first_http_ctx;
 i = 0;
 while (c1) {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: wrap around bandwidth exceeded msg text

2015-10-04 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Sun Oct  4 14:42:27 2015 -0700| 
[d8c714cb241b0c914eedf8808c5840ac8fee3a38] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: wrap around bandwidth exceeded msg text

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver.c |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 34bfa89..a45603a 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -1488,9 +1488,11 @@ static int http_parse_request(HTTPContext *c)
   "Content-type: text/html\r\n"
   "\r\n"
   "Too busy\r\n"
-  "The server is too busy to serve your request at this 
time.\r\n"
-  "The bandwidth being served (including your stream) 
is %"PRIu64"kbit/sec, "
-  "and this exceeds the limit of 
%"PRIu64"kbit/sec.\r\n"
+  "The server is too busy to serve your request at "
+  "this time.\r\n"
+  "The bandwidth being served (including your stream) "
+  "is %"PRIu64"kbit/sec, and this exceeds the limit of "
+  "%"PRIu64"kbit/sec.\r\n"
   "\r\n",
  current_bandwidth, config.max_bandwidth);
 q += strlen(q);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: unify exit path in _write_index()

2015-10-04 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Sun Oct  4 14:08:57 2015 -0700| 
[3388bcced450bfc8e6aff17f57184f29fd4a3383] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: unify exit path in _write_index()

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver.c |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 032ce22..e3c3b42 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -287,10 +287,14 @@ static int ffm_write_write_index(int fd, int64_t pos)
 for(i=0;i<8;i++)
 buf[i] = (pos >> (56 - i * 8)) & 0xff;
 if (lseek(fd, 8, SEEK_SET) < 0)
-return AVERROR(EIO);
+goto bail_eio;
 if (write(fd, buf, 8) != 8)
-return AVERROR(EIO);
+goto bail_eio;
+
 return 8;
+
+bail_eio:
+return AVERROR(EIO);
 }
 
 static void ffm_set_write_index(AVFormatContext *s, int64_t pos,

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: fix line wrapping on function decls

2015-10-04 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Fri Oct  2 14:01:24 2015 -0700| 
[1175bbd14fe36f1bbd99fd096630bcfd77767199] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: fix line wrapping on function decls

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver_config.c |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ffserver_config.c b/ffserver_config.c
index dbfda8d..691ff7b 100644
--- a/ffserver_config.c
+++ b/ffserver_config.c
@@ -685,8 +685,8 @@ static int ffserver_parse_config_global(FFServerConfig 
*config, const char *cmd,
 return 0;
 }
 
-static int ffserver_parse_config_feed(FFServerConfig *config, const char *cmd, 
const char **p,
-  FFServerStream **pfeed)
+static int ffserver_parse_config_feed(FFServerConfig *config, const char *cmd,
+  const char **p, FFServerStream **pfeed)
 {
 FFServerStream *feed;
 char arg[1024];
@@ -793,7 +793,8 @@ static int ffserver_parse_config_feed(FFServerConfig 
*config, const char *cmd, c
 return 0;
 }
 
-static int ffserver_parse_config_stream(FFServerConfig *config, const char 
*cmd, const char **p,
+static int ffserver_parse_config_stream(FFServerConfig *config, const char 
*cmd,
+const char **p,
 FFServerStream **pstream)
 {
 char arg[1024], arg2[1024];

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: avoid leaking pathname at exit

2015-10-04 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Sun Oct  4 22:29:49 2015 -0700| 
[fe95b0eb8fdfd8d531a03b621e1a21a6f3c87811] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: avoid leaking pathname at exit

Fixes Coverity CID 1325681

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/ffserver.c b/ffserver.c
index 85c9f1f..1d4c8dc 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -471,6 +471,7 @@ static void start_children(FFServerStream *feed)
 av_free (pathname);
 _exit(1);
 }
+av_free (pathname);
 }
 
 /* open a listening socket */

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: rm whitespace c leftovers from macro

2015-09-25 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Thu Sep 24 14:12:08 2015 -0700| 
[5c1acf0a09b0adeed352c2f21756a07eac379fba] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: rm whitespace c leftovers from macro

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver_config.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ffserver_config.c b/ffserver_config.c
index 4cc138e..5b97b39 100644
--- a/ffserver_config.c
+++ b/ffserver_config.c
@@ -42,8 +42,8 @@ static void report_config_error(const char *filename, int 
line_num,
 int log_level, int *errors, const char *fmt,
 ...);
 
-#define ERROR(...)   report_config_error(config->filename, config->line_num,\
- AV_LOG_ERROR, >errors,  
__VA_ARGS__)
+#define ERROR(...) report_config_error(config->filename, config->line_num,\
+   AV_LOG_ERROR, >errors, 
__VA_ARGS__)
 #define WARNING(...) report_config_error(config->filename, config->line_num,\
  AV_LOG_WARNING, >warnings, 
__VA_ARGS__)
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: drop unneeded branching

2015-09-25 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Fri Sep 25 11:04:25 2015 -0700| 
[086718e8f783889dd1d13c4ade51b6babd327521] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: drop unneeded branching

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver_config.c |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ffserver_config.c b/ffserver_config.c
index 06d9700..dbfda8d 100644
--- a/ffserver_config.c
+++ b/ffserver_config.c
@@ -137,8 +137,9 @@ void ffserver_parse_acl_row(FFServerStream *stream, 
FFServerStream* feed,
 "%s:%d: ACL refers to invalid host or IP address '%s'\n",
 filename, line_num, arg);
 goto bail;
-} else
-acl.last = acl.first;
+}
+
+acl.last = acl.first;
 
 ffserver_get_arg(arg, sizeof(arg), );
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: remove useless assignment leftover

2015-09-18 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Fri Sep 18 15:41:55 2015 -0700| 
[7a30f51446223567a6341416be38a7c30d748fd2] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: remove useless assignment leftover

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver_config.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/ffserver_config.c b/ffserver_config.c
index 5df871c..4cc138e 100644
--- a/ffserver_config.c
+++ b/ffserver_config.c
@@ -167,11 +167,9 @@ void ffserver_parse_acl_row(FFServerStream *stream, 
FFServerStream* feed,
 naclp = >acl;
 else if (ext_acl)
 naclp = _acl;
-else {
+else
 fprintf(stderr, "%s:%d: ACL found not in  or \n",
 filename, line_num);
-errors++; /* FIXME: No effect whatsoever */
-}
 
 if (naclp) {
 while (*naclp)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: start dropping all unneededly harcoded str lengths

2015-09-18 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Mon Sep 14 14:53:18 2015 -0700| 
[fb349359dc9ce7b794106ee5e5f4e33c1b56a449] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: start dropping all unneededly harcoded str lengths

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver.c |   24 ++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index f9e40b5..5b98e7a 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -71,6 +71,8 @@
 #include "cmdutils.h"
 #include "ffserver_config.h"
 
+#define PATH_LENGTH 1024
+
 const char program_name[] = "ffserver";
 const int program_birth_year = 2000;
 
@@ -388,16 +390,33 @@ static int compute_datarate(DataRateData *drd, int64_t 
count)
 
 static void start_children(FFServerStream *feed)
 {
-char pathname[1024];
+char *pathname;
 char *slash;
 int i;
+size_t cmd_length;
 
 if (no_launch)
 return;
 
+cmd_length = strlen(my_program_name);
+
+   /**
+* FIXME: WIP Safeguard. Remove after clearing all harcoded
+* '1024' path lengths
+*/
+if (cmd_length > PATH_LENGTH - 1) {
+http_log("Could not start children. Command line: '%s' exceeds "
+"path length limit (%d)\n", my_program_name, PATH_LENGTH);
+return;
+}
+
+pathname = av_strdup (my_program_name);
+if (!pathname) {
+http_log("Could not allocate memory for children cmd line\n");
+return;
+}
/* replace "ffserver" with "ffmpeg" in the path of current
 * program. Ignore user provided path */
-av_strlcpy(pathname, my_program_name, sizeof(pathname));
 
 slash = strrchr(pathname, '/');
 if (!slash)
@@ -445,6 +464,7 @@ static void start_children(FFServerStream *feed)
 
 signal(SIGPIPE, SIG_DFL);
 execvp(pathname, feed->child_argv);
+av_free (pathname);
 _exit(1);
 }
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: break early on _parse_acl_row()

2015-09-18 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Fri Sep 18 15:32:39 2015 -0700| 
[eb613877bf2b0af8c43b6bf6ec97398cfe825102] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: break early on _parse_acl_row()

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver_config.c |   50 +++---
 1 file changed, 27 insertions(+), 23 deletions(-)

diff --git a/ffserver_config.c b/ffserver_config.c
index de8a454..5df871c 100644
--- a/ffserver_config.c
+++ b/ffserver_config.c
@@ -116,6 +116,8 @@ void ffserver_parse_acl_row(FFServerStream *stream, 
FFServerStream* feed,
 {
 char arg[1024];
 FFServerIPAddressACL acl;
+FFServerIPAddressACL *nacl;
+FFServerIPAddressACL **naclp;
 int errors = 0;
 
 ffserver_get_arg(arg, sizeof(arg), );
@@ -150,33 +152,35 @@ void ffserver_parse_acl_row(FFServerStream *stream, 
FFServerStream* feed,
 }
 }
 
-if (!errors) {
-FFServerIPAddressACL *nacl = av_mallocz(sizeof(*nacl));
-FFServerIPAddressACL **naclp = 0;
-
-acl.next = 0;
-*nacl = acl;
+if (errors)
+return;
 
-if (stream)
-naclp = >acl;
-else if (feed)
-naclp = >acl;
-else if (ext_acl)
-naclp = _acl;
-else {
-fprintf(stderr, "%s:%d: ACL found not in  or \n",
-filename, line_num);
-errors++;
-}
+nacl = av_mallocz(sizeof(*nacl));
+naclp = 0;
 
-if (naclp) {
-while (*naclp)
-naclp = &(*naclp)->next;
+acl.next = 0;
+*nacl = acl;
 
-*naclp = nacl;
-} else
-av_free(nacl);
+if (stream)
+naclp = >acl;
+else if (feed)
+naclp = >acl;
+else if (ext_acl)
+naclp = _acl;
+else {
+fprintf(stderr, "%s:%d: ACL found not in  or \n",
+filename, line_num);
+errors++; /* FIXME: No effect whatsoever */
 }
+
+if (naclp) {
+while (*naclp)
+naclp = &(*naclp)->next;
+
+*naclp = nacl;
+} else
+av_free(nacl);
+
 }
 
 /* add a codec and set the default parameters */

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: explicitly free() duped filename

2015-09-18 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Fri Sep 18 15:03:34 2015 -0700| 
[c677b42f795a77f264528424294f9a5c8949345f] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: explicitly free() duped filename

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/ffserver.c b/ffserver.c
index 5b98e7a..032ce22 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -3860,6 +3860,7 @@ int main(int argc, char **argv)
 if ((ret = ffserver_parse_ffconfig(config.filename, )) < 0) {
 fprintf(stderr, "Error reading configuration file '%s': %s\n",
 config.filename, av_err2str(ret));
+av_freep();
 exit(1);
 }
 av_freep();

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: unify exit path in http_server()

2015-09-11 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@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 <reyna...@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(_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(_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 */

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: unify fail path in socket_open_listen()

2015-09-11 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Fri Sep 11 14:53:09 2015 -0700| 
[9a168e9371d6fbd69c9a88d5573a5ade095efaaf] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: unify fail path in socket_open_listen()

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver.c |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 8b6e441..2a5bc92 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -470,20 +470,22 @@ static int socket_open_listen(struct sockaddr_in *my_addr)
 snprintf(bindmsg, sizeof(bindmsg), "bind(port %d)",
  ntohs(my_addr->sin_port));
 perror (bindmsg);
-closesocket(server_fd);
-return -1;
+goto fail;
 }
 
 if (listen (server_fd, 5) < 0) {
 perror ("listen");
-closesocket(server_fd);
-return -1;
+goto fail;
 }
 
 if (ff_socket_nonblock(server_fd, 1) < 0)
 av_log(NULL, AV_LOG_WARNING, "ff_socket_nonblock failed\n");
 
 return server_fd;
+
+fail:
+closesocket(server_fd);
+return -1;
 }
 
 /* start all multicast streams */

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: remove redundant comment, clarify another one

2015-09-11 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
<reyna...@osg.samsung.com> | Fri Sep 11 17:07:52 2015 -0700| 
[314bc20d7a4bd608a51560e1f174d9ff1d16c327] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: remove redundant comment, clarify another one

Signed-off-by: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com>

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

 ffserver.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index d4b25f2..73ede87 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -1285,7 +1285,6 @@ static void compute_real_filename(char *filename, int 
max_size)
 char *p;
 FFServerStream *stream;
 
-/* compute filename by matching without the file extensions */
 av_strlcpy(file1, filename, sizeof(file1));
 p = strrchr(file1, '.');
 if (p)
@@ -1448,7 +1447,7 @@ static int http_parse_request(HTTPContext *c)
 if (c->post == 0 && stream->stream_type == STREAM_TYPE_LIVE)
 current_bandwidth += stream->bandwidth;
 
-/* If already streaming this feed, do not let start another feeder. */
+/* If already streaming this feed, do not let another feeder start */
 if (stream->feed_opened) {
 snprintf(msg, sizeof(msg), "This feed is already being received.");
 http_log("Feed '%s' already being received\n", stream->feed_filename);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: drop superfluous else clause

2015-07-26 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sun Jul 26 23:53:08 2015 -0300| 
[b16b8c815c2c94ac2bbe0ee1a1775f76963339ea] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: drop superfluous else clause

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index b4e6093..42025ab 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2541,9 +2541,8 @@ static int http_start_receive_data(HTTPContext *c)
 http_log(Error reading write index from feed file '%s': %s\n,
  c-stream-feed_filename, strerror(errno));
 return ret;
-} else {
-c-stream-feed_write_index = ret;
 }
+c-stream-feed_write_index = ret;
 }
 
 c-stream-feed_write_index = FFMAX(ffm_read_write_index(fd),

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: move decl to start of func

2015-07-26 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sun Jul 26 22:29:47 2015 -0300| 
[2ea642ff4b730fcfc70cf6dc0c959762b8c9d799] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: move decl to start of func

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffserver.c b/ffserver.c
index 5082a4c..551ef88 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -316,12 +316,12 @@ static char *ctime1(char *buf2, int buf_size)
 static void http_vlog(const char *fmt, va_list vargs)
 {
 static int print_prefix = 1;
+char buf[32];
 
 if (!logfile)
 return;
 
 if (print_prefix) {
-char buf[32];
 ctime1(buf, sizeof(buf));
 fprintf(logfile, %s , buf);
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: simplify assignment with ternary

2015-07-26 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sun Jul 26 23:11:37 2015 -0300| 
[c75bc268a2894d26e793d0c12e84d4ec6cc24860] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: simplify assignment with ternary

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |   10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 551ef88..b4e6093 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -703,13 +703,9 @@ static void start_wait_request(HTTPContext *c, int is_rtsp)
 c-buffer_ptr = c-buffer;
 c-buffer_end = c-buffer + c-buffer_size - 1; /* leave room for '\0' */
 
-if (is_rtsp) {
-c-timeout = cur_time + RTSP_REQUEST_TIMEOUT;
-c-state = RTSPSTATE_WAIT_REQUEST;
-} else {
-c-timeout = cur_time + HTTP_REQUEST_TIMEOUT;
-c-state = HTTPSTATE_WAIT_REQUEST;
-}
+c-state = is_rtsp ? RTSPSTATE_WAIT_REQUEST : HTTPSTATE_WAIT_REQUEST;
+c-timeout = cur_time +
+ is_rtsp ? RTSP_REQUEST_TIMEOUT : HTTP_REQUEST_TIMEOUT;
 }
 
 static void http_send_too_busy_reply(int fd)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: factor out stream params printing

2015-06-24 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Wed Jun 24 17:41:06 2015 -0300| 
[1714fe2990d5404b528822b324ca35cbd607a8c0] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: factor out stream params printing

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |   84 ++--
 1 file changed, 48 insertions(+), 36 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index af1a445..6b537b3 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -209,6 +209,7 @@ static void close_connection(HTTPContext *c);
 
 /* HTTP handling */
 static int handle_connection(HTTPContext *c);
+static inline void print_stream_params(AVIOContext *pb, FFServerStream 
*stream);
 static void compute_status(HTTPContext *c);
 static int open_input_stream(HTTPContext *c, const char *info);
 static int http_parse_request(HTTPContext *c);
@@ -1750,6 +1751,52 @@ static void fmt_bytecount(AVIOContext *pb, int64_t count)
 avio_printf(pb, %PRId64%c, count, *s);
 }
 
+static inline void print_stream_params(AVIOContext *pb, FFServerStream *stream)
+{
+int i, stream_no;
+const char *type = unknown;
+char parameters[64];
+AVStream *st;
+AVCodec *codec;
+
+stream_no = stream-nb_streams;
+
+avio_printf(pb, table cellspacing=0 cellpadding=4trthStreamth
+typethkbits/sth align=leftcodecth align=left
+Parameters\n);
+
+for (i = 0; i  stream_no; i++) {
+st = stream-streams[i];
+codec = avcodec_find_encoder(st-codec-codec_id);
+
+parameters[0] = 0;
+
+switch(st-codec-codec_type) {
+case AVMEDIA_TYPE_AUDIO:
+type = audio;
+snprintf(parameters, sizeof(parameters), %d channel(s), %d Hz,
+ st-codec-channels, st-codec-sample_rate);
+break;
+case AVMEDIA_TYPE_VIDEO:
+type = video;
+snprintf(parameters, sizeof(parameters),
+ %dx%d, q=%d-%d, fps=%d, st-codec-width,
+ st-codec-height, st-codec-qmin, st-codec-qmax,
+ st-codec-time_base.den / st-codec-time_base.num);
+break;
+default:
+abort();
+}
+
+avio_printf(pb, trtd align=right%dtd%std align=right%d
+td%std%s\n,
+i, type, st-codec-bit_rate/1000,
+codec ? codec-name : , parameters);
+ }
+
+ avio_printf(pb, /table\n);
+}
+
 static void compute_status(HTTPContext *c)
 {
 HTTPContext *c1;
@@ -1920,42 +1967,7 @@ static void compute_status(HTTPContext *c)
 avio_printf(pb, p);
 }
 
-avio_printf(pb, table cellspacing=0 cellpadding=4trthStreamth
-typethkbits/sth align=leftcodecth align=left
-Parameters\n);
-
-for (i = 0; i  stream-nb_streams; i++) {
-AVStream *st = stream-streams[i];
-AVCodec *codec = avcodec_find_encoder(st-codec-codec_id);
-const char *type = unknown;
-char parameters[64];
-
-parameters[0] = 0;
-
-switch(st-codec-codec_type) {
-case AVMEDIA_TYPE_AUDIO:
-type = audio;
-snprintf(parameters, sizeof(parameters), %d channel(s), %d 
Hz,
- st-codec-channels, st-codec-sample_rate);
-break;
-case AVMEDIA_TYPE_VIDEO:
-type = video;
-snprintf(parameters, sizeof(parameters),
- %dx%d, q=%d-%d, fps=%d, st-codec-width,
- st-codec-height, st-codec-qmin, st-codec-qmax,
- st-codec-time_base.den / st-codec-time_base.num);
-break;
-default:
-abort();
-}
-
-avio_printf(pb, trtd align=right%dtd%std align=right%d
-td%std%s\n,
-i, type, st-codec-bit_rate/1000,
-codec ? codec-name : , parameters);
-}
-
-avio_printf(pb, /table\n);
+print_stream_params(pb, stream);
 stream = stream-next;
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: unify comment formating drop unneeded braces

2015-06-24 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Wed Jun 24 18:49:38 2015 -0300| 
[469c335c55674b31069aaadaaae014b33def1dff] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: unify comment formating  drop unneeded braces

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |  114 
 1 file changed, 60 insertions(+), 54 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 6b537b3..1be545f 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -31,7 +31,7 @@
 #include stdlib.h
 #include stdio.h
 #include libavformat/avformat.h
-// FIXME those are internal headers, ffserver _really_ shouldn't use them
+/* FIXME: those are internal headers, ffserver _really_ shouldn't use them */
 #include libavformat/ffm.h
 #include libavformat/network.h
 #include libavformat/os_support.h
@@ -251,7 +251,8 @@ static unsigned int nb_connections;
 
 static uint64_t current_bandwidth;
 
-static int64_t cur_time;   // Making this global saves on passing it 
around everywhere
+/* Making this global saves on passing it around everywhere */
+static int64_t cur_time;
 
 static AVLFG random_state;
 
@@ -630,9 +631,8 @@ static int http_server(void)
 poll_entry++;
 } else {
 /* when ffserver is doing the timing, we work by
-   looking at which packet needs to be sent every
-   10 ms */
-/* one tick wait XXX: 10 ms assumed */
+ * looking at which packet needs to be sent every
+ * 10 ms (one tick wait XXX: 10 ms assumed) */
 if (delay  10)
 delay = 10;
 }
@@ -655,7 +655,7 @@ static int http_server(void)
 }
 
 /* wait for an event on one connection. We poll at least every
-   second to handle timeouts */
+ * second to handle timeouts */
 do {
 ret = poll(poll_table, poll_entry - poll_table, delay);
 if (ret  0  ff_neterrno() != AVERROR(EAGAIN) 
@@ -900,11 +900,11 @@ static int handle_connection(HTTPContext *c)
 if ((ptr = c-buffer + 2  !memcmp(ptr-2, \n\n, 2)) ||
 (ptr = c-buffer + 4  !memcmp(ptr-4, \r\n\r\n, 4))) {
 /* request found : parse it and reply */
-if (c-state == HTTPSTATE_WAIT_REQUEST) {
+if (c-state == HTTPSTATE_WAIT_REQUEST)
 ret = http_parse_request(c);
-} else {
+else
 ret = rtsp_parse_request(c);
-}
+
 if (ret  0)
 return -1;
 } else if (ptr = c-buffer_end) {
@@ -949,8 +949,8 @@ static int handle_connection(HTTPContext *c)
 case HTTPSTATE_SEND_DATA_HEADER:
 case HTTPSTATE_SEND_DATA_TRAILER:
 /* for packetized output, we consider we can always write (the
-   input streams set the speed). It may be better to verify
-   that we do not rely too much on the kernel queues */
+ * input streams set the speed). It may be better to verify
+ * that we do not rely too much on the kernel queues */
 if (!c-is_packetized) {
 if (c-poll_entry-revents  (POLLERR | POLLHUP))
 return -1;
@@ -1277,8 +1277,10 @@ static int validate_acl(FFServerStream *stream, 
HTTPContext *c)
 return ret;
 }
 
-/* compute the real filename of a file by matching it without its
-   extensions to all the stream's filenames */
+/**
+ * compute the real filename of a file by matching it without its
+ * extensions to all the stream's filenames
+ */
 static void compute_real_filename(char *filename, int max_size)
 {
 char file1[1024];
@@ -1396,7 +1398,7 @@ static int http_parse_request(HTTPContext *c)
 compute_real_filename(filename, sizeof(filename) - 1);
 }
 
-// redirect / request to index.html
+/* redirect request to index.html */
 if (!strlen(filename))
 av_strlcpy(filename, index.html, sizeof(filename) - 1);
 
@@ -1735,8 +1737,9 @@ static int http_parse_request(HTTPContext *c)
 return 0;
  send_status:
 compute_status(c);
-c-http_error = 200; /* horrible : we use this value to avoid
-going to the send data state */
+/* horrible: we use this value to avoid
+ * going to the send data state */
+c-http_error = 200;
 c-state = HTTPSTATE_SEND_HEADER;
 return 0;
 }
@@ -1847,8 +1850,8 @@ static void compute_status(HTTPContext *c)
 strcpy(eosf - 3, .ram);
 else if (stream-fmt  !strcmp(stream-fmt-name, rtp)) {
 /* generate a sample RTSP director if
-   unicast. Generate an SDP redirector if
-   multicast */
+ * unicast. Generate an SDP

[FFmpeg-cvslog] ffserver: make statement block unconditional by exiting early

2015-06-24 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Wed Jun 24 19:03:19 2015 -0300| 
[08724da976e9645488c215327a47c2c5a51fbe33] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: make statement block unconditional by exiting early

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |   22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index b9b6d96..5082a4c 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -3771,24 +3771,24 @@ static void compute_bandwidth(void)
 static void handle_child_exit(int sig)
 {
 pid_t pid;
-int status;
+int status, uptime;
 
 while ((pid = waitpid(-1, status, WNOHANG))  0) {
 FFServerStream *feed;
 
 for (feed = config.first_feed; feed; feed = feed-next) {
-if (feed-pid == pid) {
-int uptime = time(0) - feed-pid_start;
+if (feed-pid != pid)
+continue;
 
-feed-pid = 0;
-fprintf(stderr,
-%s: Pid %d exited with status %d after %d seconds\n,
-feed-filename, pid, status, uptime);
+uptime = time(0) - feed-pid_start;
+feed-pid = 0;
+fprintf(stderr,
+%s: Pid %d exited with status %d after %d seconds\n,
+feed-filename, pid, status, uptime);
 
-if (uptime  30)
-/* Turn off any more restarts */
-ffserver_free_child_args(feed-child_argv);
-}
+if (uptime  30)
+/* Turn off any more restarts */
+ffserver_free_child_args(feed-child_argv);
 }
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: make statement block unconditional by exiting early

2015-06-24 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Wed Jun 24 18:57:42 2015 -0300| 
[36a617c1625d5b05afa00e24c5e6291eb64c2bdf] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: make statement block unconditional by exiting early

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |   21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 1be545f..b9b6d96 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -3594,16 +3594,17 @@ static void build_feed_streams(void)
 /* gather all streams */
 for(stream = config.first_stream; stream; stream = stream-next) {
 feed = stream-feed;
-if (feed) {
-if (stream-is_feed) {
-for(i=0;istream-nb_streams;i++)
-stream-feed_streams[i] = i;
-} else {
-/* we handle a stream coming from a feed */
-for(i=0;istream-nb_streams;i++)
-stream-feed_streams[i] = add_av_stream(feed,
-
stream-streams[i]);
-}
+if (!feed)
+continue;
+
+if (stream-is_feed) {
+for(i=0;istream-nb_streams;i++)
+stream-feed_streams[i] = i;
+} else {
+/* we handle a stream coming from a feed */
+for(i=0;istream-nb_streams;i++)
+stream-feed_streams[i] = add_av_stream(feed,
+stream-streams[i]);
 }
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: simplify URLContext cleanup

2015-06-24 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Tue Jun 23 13:53:43 2015 -0300| 
[89234deaa2a4c4bac64736c23a50d299ce302a20] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: simplify URLContext cleanup

Drop unneeded var and avoid checking for NULL twice as
ffurl_closep() already does this.

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

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

diff --git a/ffserver.c b/ffserver.c
index fd7d3cb..af1a445 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -786,7 +786,6 @@ static void close_connection(HTTPContext *c)
 HTTPContext **cp, *c1;
 int i, nb_streams;
 AVFormatContext *ctx;
-URLContext *h;
 AVStream *st;
 
 /* remove connection from list */
@@ -831,9 +830,7 @@ static void close_connection(HTTPContext *c)
 av_freep(ctx-streams[0]);
 av_freep(ctx);
 }
-h = c-rtp_handles[i];
-if (h)
-ffurl_close(h);
+ffurl_close(c-rtp_handles[i]);
 }
 
 ctx = c-fmt_ctx;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: drop unneeded else branching

2015-06-21 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sun Jun 21 18:28:22 2015 -0300| 
[683f57354deb81897a1508b946bac6384088e3a8] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: drop unneeded else branching

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

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

diff --git a/ffserver.c b/ffserver.c
index 8687eba..3efa48b 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2119,11 +2119,10 @@ static int64_t get_packet_send_clock(HTTPContext *c)
 frame_bytes = c-cur_frame_bytes;
 if (frame_bytes = 0)
 return c-cur_pts;
-else {
-bytes_left = c-buffer_end - c-buffer_ptr;
-bytes_sent = frame_bytes - bytes_left;
-return c-cur_pts + (c-cur_frame_duration * bytes_sent) / frame_bytes;
-}
+
+bytes_left = c-buffer_end - c-buffer_ptr;
+bytes_sent = frame_bytes - bytes_left;
+return c-cur_pts + (c-cur_frame_duration * bytes_sent) / frame_bytes;
 }
 
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: drop unneeded else branching

2015-06-21 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sun Jun 21 18:57:13 2015 -0300| 
[6504047f82866fdc0e2a5422ad7fecb44740e9d6] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: drop unneeded else branching

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ffserver.c b/ffserver.c
index 2de35ba..fd7d3cb 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2217,7 +2217,8 @@ static int http_prepare_data(HTTPContext *c)
ffm file, so must wait for more data */
 c-state = HTTPSTATE_WAIT_FEED;
 return 1; /* state changed */
-} else if (ret == AVERROR(EAGAIN)) {
+}
+if (ret == AVERROR(EAGAIN)) {
 /* input not ready, come back later */
 return 0;
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: drop unneeded else branching

2015-06-21 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sun Jun 21 18:43:13 2015 -0300| 
[758c7a5cbc30d7fe40839e11f18f50a73011366b] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: drop unneeded else branching

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |   13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 3efa48b..2de35ba 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2220,17 +2220,16 @@ static int http_prepare_data(HTTPContext *c)
 } else if (ret == AVERROR(EAGAIN)) {
 /* input not ready, come back later */
 return 0;
+}
+if (c-stream-loop) {
+avformat_close_input(c-fmt_in);
+if (open_input_stream(c, )  0)
+goto no_loop;
+goto redo;
 } else {
-if (c-stream-loop) {
-avformat_close_input(c-fmt_in);
-if (open_input_stream(c, )  0)
-goto no_loop;
-goto redo;
-} else {
 no_loop:
 /* must send trailer now because EOF or error */
 c-state = HTTPSTATE_SEND_DATA_TRAILER;
-}
 }
 } else {
 int source_index = pkt.stream_index;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: formating

2015-06-21 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sun Jun 21 18:19:09 2015 -0300| 
[d8a04d916b24b892ed0f86963598876085929a15] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: formating

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

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

diff --git a/ffserver.c b/ffserver.c
index 2b19bba..8687eba 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -504,8 +504,7 @@ static void start_multicast(void)
 random1 = av_lfg_get(random_state);
 
 /* open the RTP connection */
-snprintf(session_id, sizeof(session_id), %08x%08x,
- random0, random1);
+snprintf(session_id, sizeof(session_id), %08x%08x, random0, random1);
 
 /* choose a port if none given */
 if (stream-multicast_port == 0) {
@@ -1166,8 +1165,10 @@ static int modify_current_stream(HTTPContext *c, char 
*rates)
 break;
 }
 
-if (c-switch_feed_streams[i] = 0  c-switch_feed_streams[i] != 
c-feed_streams[i])
+if (c-switch_feed_streams[i] = 0 
+c-switch_feed_streams[i] != c-feed_streams[i]) {
 action_required = 1;
+}
 }
 
 return action_required;
@@ -1271,9 +1272,7 @@ static int validate_acl(FFServerStream *stream, 
HTTPContext *c)
 
 if (stream-dynamic_acl[0]) {
 acl = parse_dynamic_acl(stream, c);
-
 ret = validate_acl_list(acl, c);
-
 free_acl_list(acl);
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: remove stale debug stanza

2015-03-08 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sun Mar  8 14:19:16 2015 -0300| 
[e10b2a4dc00ced101eb0bfbe38aee88fee88c563] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: remove stale debug stanza

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/ffserver.c b/ffserver.c
index e57c488..4803b96 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -3474,7 +3474,6 @@ static void extract_mpeg4_header(AVFormatContext *infile)
 if (p[0] == 0x00  p[1] == 0x00 
 p[2] == 0x01  p[3] == 0xb6) {
 size = p - pkt.data;
-//av_hex_dump_log(infile, 
AV_LOG_DEBUG, pkt.data, size);
 st-codec-extradata = av_mallocz(size + 
FF_INPUT_BUFFER_PADDING_SIZE);
 st-codec-extradata_size = size;
 memcpy(st-codec-extradata, pkt.data, size);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: break some too long lines

2015-03-08 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sun Mar  8 14:11:35 2015 -0300| 
[923a24456972567ff6f7f0534a25f33d056a6fbc] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: break some too long lines

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |   27 ++-
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 4c34cc9..29e7bd9 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2055,7 +2055,8 @@ static int open_input_stream(HTTPContext *c, const char 
*info)
 ret = avformat_open_input(s, input_filename, c-stream-ifmt,
   c-stream-in_opts);
 if (ret  0) {
-http_log(Could not open input '%s': %s\n, input_filename, 
av_err2str(ret));
+http_log(Could not open input '%s': %s\n,
+ input_filename, av_err2str(ret));
 return ret;
 }
 
@@ -2125,7 +2126,8 @@ static int http_prepare_data(HTTPContext *c)
 c-fmt_ctx = *ctx;
 av_freep(ctx);
 av_dict_copy((c-fmt_ctx.metadata), c-stream-metadata, 0);
-c-fmt_ctx.streams = av_mallocz_array(c-stream-nb_streams, 
sizeof(AVStream *));
+c-fmt_ctx.streams = av_mallocz_array(c-stream-nb_streams,
+  sizeof(AVStream *));
 
 for(i=0;ic-stream-nb_streams;i++) {
 AVStream *src;
@@ -2280,7 +2282,8 @@ static int http_prepare_data(HTTPContext *c)
 max_packet_size = RTSP_TCP_MAX_PACKET_SIZE;
 else
 max_packet_size = 
c-rtp_handles[c-packet_stream_index]-max_packet_size;
-ret = ffio_open_dyn_packet_buf(ctx-pb, 
max_packet_size);
+ret = ffio_open_dyn_packet_buf(ctx-pb,
+   max_packet_size);
 } else {
 ret = avio_open_dyn_buf(ctx-pb);
 }
@@ -2292,10 +2295,13 @@ static int http_prepare_data(HTTPContext *c)
 
 ctx-pb-seekable = 0;
 if (pkt.dts != AV_NOPTS_VALUE)
-pkt.dts = av_rescale_q(pkt.dts, ist-time_base, 
ost-time_base);
+pkt.dts = av_rescale_q(pkt.dts, ist-time_base,
+   ost-time_base);
 if (pkt.pts != AV_NOPTS_VALUE)
-pkt.pts = av_rescale_q(pkt.pts, ist-time_base, 
ost-time_base);
-pkt.duration = av_rescale_q(pkt.duration, ist-time_base, 
ost-time_base);
+pkt.pts = av_rescale_q(pkt.pts, ist-time_base,
+   ost-time_base);
+pkt.duration = av_rescale_q(pkt.duration, ist-time_base,
+ost-time_base);
 if ((ret = av_write_frame(ctx, pkt))  0) {
 http_log(Error writing frame to output for stream 
'%s': %s\n,
  c-stream-filename, av_err2str(ret));
@@ -2437,7 +2443,8 @@ static int http_send_data(HTTPContext *c)
 ffurl_write(c-rtp_handles[c-packet_stream_index],
 c-buffer_ptr, len);
 c-buffer_ptr += len;
-/* here we continue as we can send several packets per 10 
ms slot */
+/* here we continue as we can send several packets
+ * per 10 ms slot */
 }
 } else {
 /* TCP data output */
@@ -2894,7 +2901,8 @@ static void rtsp_cmd_describe(HTTPContext *c, const char 
*url)
 /* get the host IP */
 len = sizeof(my_addr);
 getsockname(c-fd, (struct sockaddr *)my_addr, len);
-content_length = prepare_sdp_description(stream, content, 
my_addr.sin_addr);
+content_length = prepare_sdp_description(stream, content,
+ my_addr.sin_addr);
 if (content_length  0) {
 rtsp_reply_error(c, RTSP_STATUS_INTERNAL);
 return;
@@ -3550,7 +3558,8 @@ static void build_feed_streams(void)
 } else {
 /* we handle a stream coming from a feed */
 for(i=0;istream-nb_streams;i++)
-stream-feed_streams[i] = add_av_stream(feed, 
stream-streams[i]);
+stream-feed_streams[i] = add_av_stream(feed,
+
stream-streams[i]);
 }
 }
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: move assignment outside condition eval

2015-03-08 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sun Mar  8 14:15:50 2015 -0300| 
[0002a22e0e4e4214a51f18d0e08517b75696c4c0] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: move assignment outside condition eval

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 29e7bd9..e57c488 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2837,9 +2837,12 @@ static int prepare_sdp_description(FFServerStream 
*stream, uint8_t **pbuffer,
 snprintf(avc-filename, 1024, rtp://0.0.0.0);
 }
 
-if (!(avc-streams = av_malloc_array(avc-nb_streams, 
sizeof(*avc-streams
+avc-streams = av_malloc_array(avc-nb_streams, sizeof(*avc-streams));
+if (!avc-streams)
 goto sdp_done;
-if (!(avs = av_malloc_array(avc-nb_streams, sizeof(*avs
+
+avs = av_malloc_array(avc-nb_streams, sizeof(*avs));
+if (!avs)
 goto sdp_done;
 
 for(i = 0; i  stream-nb_streams; i++) {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: break too-long lines

2015-02-15 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sun Feb 15 14:47:54 2015 -0300| 
[50c1cac4324fdd6b22d2d59ebd7842141f8f6461] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: break too-long lines

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |   76 
 1 file changed, 51 insertions(+), 25 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index ad67ad0..d19da7b 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -465,7 +465,8 @@ static int socket_open_listen(struct sockaddr_in *my_addr)
 my_addr-sin_family = AF_INET;
 if (bind (server_fd, (struct sockaddr *) my_addr, sizeof (*my_addr))  0) {
 char bindmsg[32];
-snprintf(bindmsg, sizeof(bindmsg), bind(port %d), 
ntohs(my_addr-sin_port));
+snprintf(bindmsg, sizeof(bindmsg), bind(port %d),
+ ntohs(my_addr-sin_port));
 perror (bindmsg);
 closesocket(server_fd);
 return -1;
@@ -725,7 +726,8 @@ static void http_send_too_busy_reply(int fd)
nb_connections, config.nb_max_connections);
 av_assert0(len  sizeof(buffer));
 if (send(fd, buffer, len, 0)  len)
-av_log(NULL, AV_LOG_WARNING, Could not send too-busy reply, send() 
failed\n);
+av_log(NULL, AV_LOG_WARNING,
+   Could not send too-busy reply, send() failed\n);
 }
 
 
@@ -1091,7 +1093,8 @@ static int extract_rates(char *rates, int ratelen, const 
char *request)
 return 0;
 }
 
-static int find_stream_in_feed(FFServerStream *feed, AVCodecContext *codec, 
int bit_rate)
+static int find_stream_in_feed(FFServerStream *feed, AVCodecContext *codec,
+   int bit_rate)
 {
 int i;
 int best_bitrate = 1;
@@ -1113,7 +1116,8 @@ static int find_stream_in_feed(FFServerStream *feed, 
AVCodecContext *codec, int
  */
 
 if (feed_codec-bit_rate = bit_rate) {
-if (best_bitrate  bit_rate || feed_codec-bit_rate  
best_bitrate) {
+if (best_bitrate  bit_rate ||
+feed_codec-bit_rate  best_bitrate) {
 best_bitrate = feed_codec-bit_rate;
 best = i;
 }
@@ -1183,7 +1187,8 @@ static void get_word(char *buf, int buf_size, const char 
**pp)
 *pp = p;
 }
 
-static FFServerIPAddressACL* parse_dynamic_acl(FFServerStream *stream, 
HTTPContext *c)
+static FFServerIPAddressACL* parse_dynamic_acl(FFServerStream *stream,
+   HTTPContext *c)
 {
 FILE* f;
 char line[1024];
@@ -1211,7 +1216,8 @@ static FFServerIPAddressACL* 
parse_dynamic_acl(FFServerStream *stream, HTTPConte
 ffserver_get_arg(cmd, sizeof(cmd), p);
 
 if (!av_strcasecmp(cmd, ACL))
-ffserver_parse_acl_row(NULL, NULL, acl, p, stream-dynamic_acl, 
line_num);
+ffserver_parse_acl_row(NULL, NULL, acl, p, stream-dynamic_acl,
+   line_num);
 }
 fclose(f);
 return acl;
@@ -1339,7 +1345,8 @@ static int http_parse_request(HTTPContext *c)
 av_strlcpy(c-protocol, protocol, sizeof(c-protocol));
 
 if (config.debug)
-http_log(%s - - New connection: %s %s\n, 
inet_ntoa(c-from_addr.sin_addr), cmd, url);
+http_log(%s - - New connection: %s %s\n,
+ inet_ntoa(c-from_addr.sin_addr), cmd, url);
 
 /* find the filename and the optional info string in the request */
 p1 = strchr(url, '?');
@@ -1414,7 +1421,8 @@ static int http_parse_request(HTTPContext *c)
   \r\n
   htmlheadtitleMoved/title/headbody\r\n
   You should be a href=\%s\redirected/a.\r\n
-  /body/html\r\n, stream-feed_filename, 
stream-feed_filename);
+  /body/html\r\n,
+ stream-feed_filename, stream-feed_filename);
 q += strlen(q);
 /* prepare output buffer */
 c-buffer_ptr = c-buffer;
@@ -1454,7 +1462,8 @@ static int http_parse_request(HTTPContext *c)
   pThe server is too busy to serve your request at this 
time./p\r\n
   pThe bandwidth being served (including your stream) 
is %PRIu64kbit/sec, 
   and this exceeds the limit of 
%PRIu64kbit/sec./p\r\n
-  /body/html\r\n, current_bandwidth, 
config.max_bandwidth);
+  /body/html\r\n,
+ current_bandwidth, config.max_bandwidth);
 q += strlen(q);
 /* prepare output buffer */
 c-buffer_ptr = c-buffer;
@@ -1760,7 +1769,8 @@ static void compute_status(HTTPContext *c)
 
 avio_printf(pb, htmlheadtitle%s Status/title\n, program_name);
 if (c-stream-feed_filename[0])
-avio_printf(pb, link rel=\shortcut icon\ href=\%s\\n, 
c-stream

[FFmpeg-cvslog] ffserver: fix wrong indentation

2015-02-15 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sun Feb 15 14:58:47 2015 -0300| 
[df4346c541ca8e843ae1a87f8fb12f15659e79a5] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: fix wrong indentation

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffserver.c b/ffserver.c
index b3fb6c5..4c34cc9 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2419,7 +2419,7 @@ static int http_send_data(HTTPContext *c)
 
 /* send everything we can NOW */
 len = send(rtsp_c-fd, rtsp_c-packet_buffer_ptr,
-rtsp_c-packet_buffer_end - 
rtsp_c-packet_buffer_ptr, 0);
+   rtsp_c-packet_buffer_end - 
rtsp_c-packet_buffer_ptr, 0);
 if (len  0)
 rtsp_c-packet_buffer_ptr += len;
 if (rtsp_c-packet_buffer_ptr  rtsp_c-packet_buffer_end) 
{

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: reorder HTTP fwd decls

2015-02-15 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sun Feb 15 13:23:06 2015 -0300| 
[8129ccec3a6a5bd100ccf292d4abe5b388426e95] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: reorder HTTP fwd decls

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 0946d0e..ad67ad0 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -209,10 +209,10 @@ static void close_connection(HTTPContext *c);
 
 /* HTTP handling */
 static int handle_connection(HTTPContext *c);
-static int http_parse_request(HTTPContext *c);
-static int http_send_data(HTTPContext *c);
 static void compute_status(HTTPContext *c);
 static int open_input_stream(HTTPContext *c, const char *info);
+static int http_parse_request(HTTPContext *c);
+static int http_send_data(HTTPContext *c);
 static int http_start_receive_data(HTTPContext *c);
 static int http_receive_data(HTTPContext *c);
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: decouple assignment and check

2015-02-15 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sun Feb 15 14:54:34 2015 -0300| 
[bd8e16f2e6f069dd8f63b5c22821b581ffe3151a] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: decouple assignment and check

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index d19da7b..b3fb6c5 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2052,7 +2052,9 @@ static int open_input_stream(HTTPContext *c, const char 
*info)
 }
 
 /* open stream */
-if ((ret = avformat_open_input(s, input_filename, c-stream-ifmt, 
c-stream-in_opts))  0) {
+ret = avformat_open_input(s, input_filename, c-stream-ifmt,
+  c-stream-in_opts);
+if (ret  0) {
 http_log(Could not open input '%s': %s\n, input_filename, 
av_err2str(ret));
 return ret;
 }
@@ -3504,7 +3506,9 @@ static void build_file_streams(void)
 
 http_log(Opening feed file '%s' for stream '%s'\n,
  stream-feed_filename, stream-filename);
-if ((ret = avformat_open_input(infile, stream-feed_filename, 
stream-ifmt, stream-in_opts))  0) {
+ret = avformat_open_input(infile, stream-feed_filename,
+  stream-ifmt, stream-in_opts);
+if (ret  0) {
 http_log(Could not open '%s': %s\n, stream-feed_filename,
  av_err2str(ret));
 /* remove stream (no need to spend more time on it) */

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: reflow find_stream_in_feed()

2015-01-23 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sat Jan 24 01:56:18 2015 -0300| 
[2699a378167550d50f2b32587bdbc985a2a6bc54] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: reflow find_stream_in_feed()

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index f3b2b19..0946d0e 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -1117,14 +1117,13 @@ static int find_stream_in_feed(FFServerStream *feed, 
AVCodecContext *codec, int
 best_bitrate = feed_codec-bit_rate;
 best = i;
 }
-} else {
-if (feed_codec-bit_rate  best_bitrate) {
-best_bitrate = feed_codec-bit_rate;
-best = i;
-}
+continue;
+}
+if (feed_codec-bit_rate  best_bitrate) {
+best_bitrate = feed_codec-bit_rate;
+best = i;
 }
 }
-
 return best;
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: reflow http_vlog()

2015-01-23 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sat Jan 24 01:10:35 2015 -0300| 
[e97545646af74536a3674954ade51464f51f38dc] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: reflow http_vlog()

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 0b69196..6d75ad6 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -314,7 +314,10 @@ static char *ctime1(char *buf2, int buf_size)
 static void http_vlog(const char *fmt, va_list vargs)
 {
 static int print_prefix = 1;
-if (logfile) {
+
+if (!logfile)
+return;
+
 if (print_prefix) {
 char buf[32];
 ctime1(buf, sizeof(buf));
@@ -323,7 +326,6 @@ static void http_vlog(const char *fmt, va_list vargs)
 print_prefix = strstr(fmt, \n) != NULL;
 vfprintf(logfile, fmt, vargs);
 fflush(logfile);
-}
 }
 
 #ifdef __GNUC__

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: reindent http_vlog()

2015-01-23 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sat Jan 24 01:11:58 2015 -0300| 
[7d3857b7ab590752a9c3a32fab7559ec8ad49537] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: reindent http_vlog()

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 6d75ad6..578e560 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -318,14 +318,14 @@ static void http_vlog(const char *fmt, va_list vargs)
 if (!logfile)
 return;
 
-if (print_prefix) {
-char buf[32];
-ctime1(buf, sizeof(buf));
-fprintf(logfile, %s , buf);
-}
-print_prefix = strstr(fmt, \n) != NULL;
-vfprintf(logfile, fmt, vargs);
-fflush(logfile);
+if (print_prefix) {
+char buf[32];
+ctime1(buf, sizeof(buf));
+fprintf(logfile, %s , buf);
+}
+print_prefix = strstr(fmt, \n) != NULL;
+vfprintf(logfile, fmt, vargs);
+fflush(logfile);
 }
 
 #ifdef __GNUC__

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: reflow handle_connection()

2015-01-23 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sat Jan 24 01:35:39 2015 -0300| 
[eadd66a4aff74fd39f8847b655c4ad3a1ac5db2e] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: reflow handle_connection()

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |   25 +
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 578e560..06bcb2d 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -870,6 +870,7 @@ static void close_connection(HTTPContext *c)
 static int handle_connection(HTTPContext *c)
 {
 int len, ret;
+uint8_t *ptr;
 
 switch(c-state) {
 case HTTPSTATE_WAIT_REQUEST:
@@ -885,16 +886,16 @@ static int handle_connection(HTTPContext *c)
 return 0;
 /* read the data */
 read_loop:
-len = recv(c-fd, c-buffer_ptr, 1, 0);
+if (!(len = recv(c-fd, c-buffer_ptr, 1, 0)))
+return -1;
+
 if (len  0) {
 if (ff_neterrno() != AVERROR(EAGAIN) 
 ff_neterrno() != AVERROR(EINTR))
 return -1;
-} else if (len == 0) {
-return -1;
-} else {
+break;
+}
 /* search for end of request. */
-uint8_t *ptr;
 c-buffer_ptr += len;
 ptr = c-buffer_ptr;
 if ((ptr = c-buffer + 2  !memcmp(ptr-2, \n\n, 2)) ||
@@ -911,7 +912,7 @@ static int handle_connection(HTTPContext *c)
 /* request too long: cannot do anything */
 return -1;
 } else goto read_loop;
-}
+
 break;
 
 case HTTPSTATE_SEND_HEADER:
@@ -927,7 +928,8 @@ static int handle_connection(HTTPContext *c)
 ff_neterrno() != AVERROR(EINTR)) {
 goto close_connection;
 }
-} else {
+break;
+}
 c-buffer_ptr += len;
 if (c-stream)
 c-stream-bytes_served += len;
@@ -942,7 +944,6 @@ static int handle_connection(HTTPContext *c)
 c-state = HTTPSTATE_SEND_DATA_HEADER;
 c-buffer_ptr = c-buffer_end = c-buffer;
 }
-}
 break;
 
 case HTTPSTATE_SEND_DATA:
@@ -994,7 +995,8 @@ static int handle_connection(HTTPContext *c)
 ff_neterrno() != AVERROR(EINTR)) {
 goto close_connection;
 }
-} else {
+break;
+}
 c-buffer_ptr += len;
 c-data_count += len;
 if (c-buffer_ptr = c-buffer_end) {
@@ -1002,7 +1004,6 @@ static int handle_connection(HTTPContext *c)
 av_freep(c-pb_buffer);
 start_wait_request(c, 1);
 }
-}
 break;
 case RTSPSTATE_SEND_PACKET:
 if (c-poll_entry-revents  (POLLERR | POLLHUP)) {
@@ -1021,14 +1022,14 @@ static int handle_connection(HTTPContext *c)
 av_freep(c-packet_buffer);
 return -1;
 }
-} else {
+break;
+}
 c-packet_buffer_ptr += len;
 if (c-packet_buffer_ptr = c-packet_buffer_end) {
 /* all the buffer was sent : wait for a new request */
 av_freep(c-packet_buffer);
 c-state = RTSPSTATE_WAIT_REQUEST;
 }
-}
 break;
 case HTTPSTATE_READY:
 /* nothing to do */

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: reindent compute_status()

2015-01-03 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Fri Jan  2 23:01:10 2015 -0300| 
[9e55130a9d84f211608a5f405f245c93a5abe135] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: reindent compute_status()

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |  284 
 1 file changed, 151 insertions(+), 133 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 93e5467..dfed412 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -1774,153 +1774,172 @@ static void compute_status(HTTPContext *c)
 stream = stream-next;
 continue;
 }
-av_strlcpy(sfilename, stream-filename, sizeof(sfilename) - 10);
-eosf = sfilename + strlen(sfilename);
-if (eosf - sfilename = 4) {
-if (strcmp(eosf - 4, .asf) == 0)
-strcpy(eosf - 4, .asx);
-else if (strcmp(eosf - 3, .rm) == 0)
-strcpy(eosf - 3, .ram);
-else if (stream-fmt  !strcmp(stream-fmt-name, rtp)) {
-/* generate a sample RTSP director if
-   unicast. Generate an SDP redirector if
-   multicast */
-eosf = strrchr(sfilename, '.');
-if (!eosf)
-eosf = sfilename + strlen(sfilename);
-if (stream-is_multicast)
-strcpy(eosf, .sdp);
-else
-strcpy(eosf, .rtsp);
-}
+
+av_strlcpy(sfilename, stream-filename, sizeof(sfilename) - 10);
+eosf = sfilename + strlen(sfilename);
+if (eosf - sfilename = 4) {
+if (strcmp(eosf - 4, .asf) == 0)
+strcpy(eosf - 4, .asx);
+else if (strcmp(eosf - 3, .rm) == 0)
+strcpy(eosf - 3, .ram);
+else if (stream-fmt  !strcmp(stream-fmt-name, rtp)) {
+/* generate a sample RTSP director if
+   unicast. Generate an SDP redirector if
+   multicast */
+eosf = strrchr(sfilename, '.');
+if (!eosf)
+eosf = sfilename + strlen(sfilename);
+if (stream-is_multicast)
+strcpy(eosf, .sdp);
+else
+strcpy(eosf, .rtsp);
 }
+}
 
-avio_printf(pb, trtda href=\/%s\%s/a ,
- sfilename, stream-filename);
-avio_printf(pb, td align=right %d td align=right ,
-stream-conns_served);
-fmt_bytecount(pb, stream-bytes_served);
-switch(stream-stream_type) {
-case STREAM_TYPE_LIVE: {
-int audio_bit_rate = 0;
-int video_bit_rate = 0;
-const char *audio_codec_name = ;
-const char *video_codec_name = ;
-const char *audio_codec_name_extra = ;
-const char *video_codec_name_extra = ;
-
-for(i=0;istream-nb_streams;i++) {
-AVStream *st = stream-streams[i];
-AVCodec *codec = 
avcodec_find_encoder(st-codec-codec_id);
-switch(st-codec-codec_type) {
-case AVMEDIA_TYPE_AUDIO:
-audio_bit_rate += st-codec-bit_rate;
-if (codec) {
-if (*audio_codec_name)
-audio_codec_name_extra = ...;
-audio_codec_name = codec-name;
-}
-break;
-case AVMEDIA_TYPE_VIDEO:
-video_bit_rate += st-codec-bit_rate;
-if (codec) {
-if (*video_codec_name)
-video_codec_name_extra = ...;
-video_codec_name = codec-name;
-}
-break;
-case AVMEDIA_TYPE_DATA:
-video_bit_rate += st-codec-bit_rate;
-break;
-default:
-abort();
-}
+avio_printf(pb, trtda href=\/%s\%s/a ,
+sfilename, stream-filename);
+avio_printf(pb, td align=right %d td align=right ,
+stream-conns_served);
+fmt_bytecount(pb, stream-bytes_served);
+
+switch(stream-stream_type) {
+case STREAM_TYPE_LIVE: {
+int audio_bit_rate = 0;
+int video_bit_rate = 0;
+const char

[FFmpeg-cvslog] ffserver: reflow rtsp_cmd_setup()

2015-01-03 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sat Jan  3 20:12:15 2015 -0300| 
[ac1940b2ba7d999f2da6100a2cf6cab30e216f3e] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: reflow rtsp_cmd_setup()

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 8f564ab..129eb30 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2937,8 +2937,10 @@ static void rtsp_cmd_setup(HTTPContext *c, const char 
*url,
 
 /* now check each stream */
 for(stream = config.first_stream; stream; stream = stream-next) {
-if (!stream-is_feed 
-stream-fmt  !strcmp(stream-fmt-name, rtp)) {
+if (stream-is_feed || !stream-fmt ||
+strcmp(stream-fmt-name, rtp)) {
+continue;
+}
 /* accept aggregate filenames only if single stream */
 if (!strcmp(path, stream-filename)) {
 if (stream-nb_streams != 1) {
@@ -2956,7 +2958,6 @@ static void rtsp_cmd_setup(HTTPContext *c, const char 
*url,
 if (!strcmp(path, buf))
 goto found;
 }
-}
 }
 /* no stream found */
 rtsp_reply_error(c, RTSP_STATUS_SERVICE); /* XXX: right error ? */

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: drop redundant else clause

2015-01-03 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sat Jan  3 20:06:19 2015 -0300| 
[196bc03a869a8744612e5355efee119a03578ec3] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: drop redundant else clause

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index dfed412..8f564ab 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2435,8 +2435,8 @@ static int http_send_data(HTTPContext *c)
 return -1;
 else
 return 0;
-} else
-c-buffer_ptr += len;
+}
+c-buffer_ptr += len;
 
 c-data_count += len;
 update_datarate(c-datarate, c-data_count);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: reindent rtsp_cmd_setup()

2015-01-03 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sat Jan  3 20:17:28 2015 -0300| 
[997508847215a852d2f5d564e641f38f8bd93c46] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: reindent rtsp_cmd_setup()

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |   30 +++---
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 129eb30..c4cf390 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2941,23 +2941,23 @@ static void rtsp_cmd_setup(HTTPContext *c, const char 
*url,
 strcmp(stream-fmt-name, rtp)) {
 continue;
 }
-/* accept aggregate filenames only if single stream */
-if (!strcmp(path, stream-filename)) {
-if (stream-nb_streams != 1) {
-rtsp_reply_error(c, RTSP_STATUS_AGGREGATE);
-return;
-}
-stream_index = 0;
-goto found;
+/* accept aggregate filenames only if single stream */
+if (!strcmp(path, stream-filename)) {
+if (stream-nb_streams != 1) {
+rtsp_reply_error(c, RTSP_STATUS_AGGREGATE);
+return;
 }
+stream_index = 0;
+goto found;
+}
 
-for(stream_index = 0; stream_index  stream-nb_streams;
-stream_index++) {
-snprintf(buf, sizeof(buf), %s/streamid=%d,
- stream-filename, stream_index);
-if (!strcmp(path, buf))
-goto found;
-}
+for(stream_index = 0; stream_index  stream-nb_streams;
+stream_index++) {
+snprintf(buf, sizeof(buf), %s/streamid=%d,
+ stream-filename, stream_index);
+if (!strcmp(path, buf))
+goto found;
+}
 }
 /* no stream found */
 rtsp_reply_error(c, RTSP_STATUS_SERVICE); /* XXX: right error ? */

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: reflow compute_status()

2015-01-03 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Fri Jan  2 22:30:05 2015 -0300| 
[907101eb8395564dd9485c7e97fb1b5ae6afb9ad] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: reflow compute_status()

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 9472c41..93e5467 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -1770,7 +1770,10 @@ static void compute_status(HTTPContext *c)
 char sfilename[1024];
 char *eosf;
 
-if (stream-feed != stream) {
+if (stream-feed == stream) {
+stream = stream-next;
+continue;
+}
 av_strlcpy(sfilename, stream-filename, sizeof(sfilename) - 10);
 eosf = sfilename + strlen(sfilename);
 if (eosf - sfilename = 4) {
@@ -1849,14 +1852,16 @@ static void compute_status(HTTPContext *c)
 avio_printf(pb, td align=center - td align=right - td 
align=right - tdtd align=right - td\n);
 break;
 }
-}
 stream = stream-next;
 }
 avio_printf(pb, /table\n);
 
 stream = config.first_stream;
 while (stream) {
-if (stream-feed == stream) {
+if (stream-feed != stream) {
+stream = stream-next;
+continue;
+}
 avio_printf(pb, h2Feed %s/h2, stream-filename);
 if (stream-pid) {
 avio_printf(pb, Running as pid %d.\n, stream-pid);
@@ -1916,7 +1921,6 @@ static void compute_status(HTTPContext *c)
 }
 avio_printf(pb, /table\n);
 
-}
 stream = stream-next;
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: reflow start_children()

2014-12-26 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Tue Dec  9 02:57:02 2014 -0300| 
[ec42251715294719e790e4cc48b29f99e74b2a65] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: reflow start_children()

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |   40 +++-
 1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 5ae7406..d1e6638 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -384,11 +384,29 @@ static int compute_datarate(DataRateData *drd, int64_t 
count)
 
 static void start_children(FFServerStream *feed)
 {
+char pathname[1024];
+char *slash;
+int i;
+
 if (no_launch)
 return;
 
+   /* replace ffserver with ffmpeg in the path of current
+* program. Ignore user provided path */
+av_strlcpy(pathname, my_program_name, sizeof(pathname));
+
+slash = strrchr(pathname, '/');
+if (!slash)
+slash = pathname;
+else
+slash++;
+strcpy(slash, ffmpeg);
+
 for (; feed; feed = feed-next) {
-if (feed-child_argv  !feed-pid) {
+
+if (!feed-child_argv || feed-pid)
+continue;
+
 feed-pid_start = time(0);
 
 feed-pid = fork();
@@ -397,21 +415,11 @@ static void start_children(FFServerStream *feed)
 http_log(Unable to create children\n);
 exit(1);
 }
-if (!feed-pid) {
+
+if (feed-pid)
+continue;
+
 /* In child */
-char pathname[1024];
-char *slash;
-int i;
-
-/* replace ffserver with ffmpeg in the path of current
- * program. Ignore user provided path */
-av_strlcpy(pathname, my_program_name, sizeof(pathname));
-slash = strrchr(pathname, '/');
-if (!slash)
-slash = pathname;
-else
-slash++;
-strcpy(slash, ffmpeg);
 
 http_log(Launch command line: );
 http_log(%s , pathname);
@@ -436,8 +444,6 @@ static void start_children(FFServerStream *feed)
 execvp(pathname, feed-child_argv);
 
 _exit(1);
-}
-}
 }
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: reindent start_children()

2014-12-26 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Tue Dec  9 03:03:41 2014 -0300| 
[18011888cc8791ab6c3d1a3563ff62a834f77a92] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: reindent start_children()

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |   56 +++-
 1 file changed, 27 insertions(+), 29 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index d1e6638..94d315f 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -407,43 +407,41 @@ static void start_children(FFServerStream *feed)
 if (!feed-child_argv || feed-pid)
 continue;
 
-feed-pid_start = time(0);
+feed-pid_start = time(0);
 
-feed-pid = fork();
-
-if (feed-pid  0) {
-http_log(Unable to create children\n);
-exit(1);
-}
-
-if (feed-pid)
-continue;
+feed-pid = fork();
+if (feed-pid  0) {
+http_log(Unable to create children\n);
+exit(1);
+}
 
-/* In child */
+if (feed-pid)
+continue;
 
-http_log(Launch command line: );
-http_log(%s , pathname);
-for (i = 1; feed-child_argv[i]  feed-child_argv[i][0]; i++)
-http_log(%s , feed-child_argv[i]);
-http_log(\n);
+/* In child */
 
-for (i = 3; i  256; i++)
-close(i);
+http_log(Launch command line: );
+http_log(%s , pathname);
 
-if (!config.debug) {
-if (!freopen(/dev/null, r, stdin))
-http_log(failed to redirect STDIN to /dev/null\n;);
-if (!freopen(/dev/null, w, stdout))
-http_log(failed to redirect STDOUT to /dev/null\n;);
-if (!freopen(/dev/null, w, stderr))
-http_log(failed to redirect STDERR to /dev/null\n;);
-}
+for (i = 1; feed-child_argv[i]  feed-child_argv[i][0]; i++)
+http_log(%s , feed-child_argv[i]);
+http_log(\n);
 
-signal(SIGPIPE, SIG_DFL);
+for (i = 3; i  256; i++)
+close(i);
 
-execvp(pathname, feed-child_argv);
+if (!config.debug) {
+if (!freopen(/dev/null, r, stdin))
+http_log(failed to redirect STDIN to /dev/null\n;);
+if (!freopen(/dev/null, w, stdout))
+http_log(failed to redirect STDOUT to /dev/null\n;);
+if (!freopen(/dev/null, w, stderr))
+http_log(failed to redirect STDERR to /dev/null\n;);
+}
 
-_exit(1);
+signal(SIGPIPE, SIG_DFL);
+execvp(pathname, feed-child_argv);
+_exit(1);
 }
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: break lines at 80 in func prototypes

2014-12-26 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Tue Dec  9 02:04:10 2014 -0300| 
[1abdfb100ac6b47b20db1af7b3402c3517c4b9d4] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: break lines at 80 in func prototypes

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index ab3e6e9..5ae7406 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -220,9 +220,12 @@ static int http_receive_data(HTTPContext *c);
 static int rtsp_parse_request(HTTPContext *c);
 static void rtsp_cmd_describe(HTTPContext *c, const char *url);
 static void rtsp_cmd_options(HTTPContext *c, const char *url);
-static void rtsp_cmd_setup(HTTPContext *c, const char *url, RTSPMessageHeader 
*h);
-static void rtsp_cmd_play(HTTPContext *c, const char *url, RTSPMessageHeader 
*h);
-static void rtsp_cmd_interrupt(HTTPContext *c, const char *url, 
RTSPMessageHeader *h, int pause_only);
+static void rtsp_cmd_setup(HTTPContext *c, const char *url,
+   RTSPMessageHeader *h);
+static void rtsp_cmd_play(HTTPContext *c, const char *url,
+  RTSPMessageHeader *h);
+static void rtsp_cmd_interrupt(HTTPContext *c, const char *url,
+   RTSPMessageHeader *h, int pause_only);
 
 /* SDP handling */
 static int prepare_sdp_description(FFServerStream *stream, uint8_t **pbuffer,
@@ -230,7 +233,8 @@ static int prepare_sdp_description(FFServerStream *stream, 
uint8_t **pbuffer,
 
 /* RTP handling */
 static HTTPContext *rtp_new_connection(struct sockaddr_in *from_addr,
-   FFServerStream *stream, const char 
*session_id,
+   FFServerStream *stream,
+   const char *session_id,
enum RTSPLowerTransport rtp_protocol);
 static int rtp_new_av_stream(HTTPContext *c,
  int stream_index, struct sockaddr_in *dest_addr,

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: reindent start_multicast()

2014-12-26 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Fri Dec 26 18:17:47 2014 -0300| 
[978bc4327b11d75fdc5302a83dbf70499068eded] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: reindent start_multicast()

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |   74 +++-
 1 file changed, 38 insertions(+), 36 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 0094d28..beda07a 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -493,50 +493,52 @@ static void start_multicast(void)
 
 default_port = 6000;
 for(stream = config.first_stream; stream; stream = stream-next) {
+
 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);
-
-/* choose a port if none given */
-if (stream-multicast_port == 0) {
-stream-multicast_port = default_port;
-default_port += 100;
-}
 
-dest_addr.sin_family = AF_INET;
-dest_addr.sin_addr = stream-multicast_ip;
-dest_addr.sin_port = htons(stream-multicast_port);
+random0 = av_lfg_get(random_state);
+random1 = av_lfg_get(random_state);
 
-rtp_c = rtp_new_connection(dest_addr, stream, session_id,
-   RTSP_LOWER_TRANSPORT_UDP_MULTICAST);
-if (!rtp_c)
-continue;
+/* open the RTP connection */
+snprintf(session_id, sizeof(session_id), %08x%08x,
+ random0, random1);
+
+/* choose a port if none given */
+if (stream-multicast_port == 0) {
+stream-multicast_port = default_port;
+default_port += 100;
+}
 
-if (open_input_stream(rtp_c, )  0) {
-http_log(Could not open input stream for stream '%s'\n,
- stream-filename);
+dest_addr.sin_family = AF_INET;
+dest_addr.sin_addr = stream-multicast_ip;
+dest_addr.sin_port = htons(stream-multicast_port);
+
+rtp_c = rtp_new_connection(dest_addr, stream, session_id,
+   RTSP_LOWER_TRANSPORT_UDP_MULTICAST);
+if (!rtp_c)
+continue;
+
+if (open_input_stream(rtp_c, )  0) {
+http_log(Could not open input stream for stream '%s'\n,
+ stream-filename);
+continue;
+}
+
+/* open each RTP stream */
+for(stream_index = 0; stream_index  stream-nb_streams;
+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)
 continue;
-}
 
-/* open each RTP stream */
-for(stream_index = 0; stream_index  stream-nb_streams;
-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) {
-continue;
-}
-http_log(Could not open output stream '%s/streamid=%d'\n,
- stream-filename, stream_index);
-exit(1);
-}
+http_log(Could not open output stream '%s/streamid=%d'\n,
+ stream-filename, stream_index);
+exit(1);
+}
 
-rtp_c-state = HTTPSTATE_SEND_DATA;
+rtp_c-state = HTTPSTATE_SEND_DATA;
 }
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: reflow start_multicast()

2014-12-26 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Fri Dec 26 18:03:25 2014 -0300| 
[719cc025869b59bbdc438ffe2236a0c7e0062d17] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: reflow start_multicast()

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |   15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 94d315f..0094d28 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;
-}
 }
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: minor formatting improvement to http_server()

2014-12-26 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Fri Dec 26 18:34:52 2014 -0300| 
[114622369939f0a6a9794d273e6c5adad17a437c] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: minor formatting improvement to http_server()

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index beda07a..7ddacd2 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -550,8 +550,11 @@ static int http_server(void)
 struct pollfd *poll_table, *poll_entry;
 HTTPContext *c, *c_next;
 
-if(!(poll_table = av_mallocz_array(config.nb_max_http_connections + 2, 
sizeof(*poll_table {
-http_log(Impossible to allocate a poll table handling %d 
connections.\n, config.nb_max_http_connections);
+poll_table = av_mallocz_array(config.nb_max_http_connections + 2,
+  sizeof(*poll_table));
+if(!poll_table) {
+http_log(Impossible to allocate a poll table handling %d 
+ connections.\n, config.nb_max_http_connections);
 return -1;
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: check for EOF|error at loop condition

2014-12-26 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Fri Dec 26 19:01:31 2014 -0300| 
[a18456a2032e49385447a1d0d2f146f65fe9a5e1] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: check for EOF|error at loop condition

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

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

diff --git a/ffserver.c b/ffserver.c
index 044bf6f..9472c41 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -1199,9 +1199,7 @@ static FFServerIPAddressACL* 
parse_dynamic_acl(FFServerStream *stream, HTTPConte
 acl = av_mallocz(sizeof(FFServerIPAddressACL));
 
 /* Build ACL */
-for(;;) {
-if (fgets(line, sizeof(line), f) == NULL)
-break;
+while (fgets(line, sizeof(line), f)) {
 line_num++;
 p = line;
 while (av_isspace(*p))

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: reflow close_connection()

2014-12-26 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Fri Dec 26 18:43:40 2014 -0300| 
[0121ddabb8677730f415115c8f9d50e27269111e] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: reflow close_connection()

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |   12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 7ddacd2..044bf6f 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -836,13 +836,11 @@ static void close_connection(HTTPContext *c)
 ctx = c-fmt_ctx;
 
 if (!c-last_packet_sent  c-state == HTTPSTATE_SEND_DATA_TRAILER) {
-if (ctx-oformat) {
-/* prepare header */
-if (avio_open_dyn_buf(ctx-pb) = 0) {
-av_write_trailer(ctx);
-av_freep(c-pb_buffer);
-avio_close_dyn_buf(ctx-pb, c-pb_buffer);
-}
+/* prepare header */
+if (ctx-oformat  avio_open_dyn_buf(ctx-pb) = 0) {
+av_write_trailer(ctx);
+av_freep(c-pb_buffer);
+avio_close_dyn_buf(ctx-pb, c-pb_buffer);
 }
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver_config: check strchr() return for NULL

2014-12-08 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Mon Dec  8 12:42:39 2014 -0300| 
[f95cfff07765912676cc613b55e2234b5d70f1bd] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver_config: check strchr() return for NULL

Should fix FFmpeg Coverity Scan issue #1257013

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver_config.c |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/ffserver_config.c b/ffserver_config.c
index ccc35d7..51e3f49 100644
--- a/ffserver_config.c
+++ b/ffserver_config.c
@@ -520,7 +520,13 @@ static int ffserver_save_avoption(const char *opt, const 
char *arg, int type, FF
 //explicit private option
 snprintf(buff, sizeof(buff), %s, opt);
 codec_name = buff;
-option = strchr(buff, ':');
+if(!(option = strchr(buff, ':'))){
+report_config_error(config-filename, config-line_num,
+AV_LOG_ERROR, config-errors,
+Syntax error. Unmatched ':'\n);
+return -1;
+
+}
 buff[option - buff] = '\0';
 option++;
 if ((ret = ffserver_set_codec(ctx, codec_name, config))  0)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver_config: break lines at 80 chars

2014-12-08 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Mon Dec  8 17:25:35 2014 -0300| 
[b4c69b7ea8c0683f5a4b659d055132db328a1351] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver_config: break lines at 80 chars

Add braces when needed and drop redundant parethesis while at it.

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver_config.c |  168 +
 1 file changed, 105 insertions(+), 63 deletions(-)

diff --git a/ffserver_config.c b/ffserver_config.c
index 6c7b9b8..d17b57e 100644
--- a/ffserver_config.c
+++ b/ffserver_config.c
@@ -132,7 +132,8 @@ void ffserver_parse_acl_row(FFServerStream *stream, 
FFServerStream* feed,
 ffserver_get_arg(arg, sizeof(arg), p);
 
 if (resolve_host(acl.first, arg)) {
-fprintf(stderr, %s:%d: ACL refers to invalid host or IP address 
'%s'\n,
+fprintf(stderr,
+%s:%d: ACL refers to invalid host or IP address '%s'\n,
 filename, line_num, arg);
 errors++;
 } else
@@ -196,7 +197,8 @@ static void add_codec(FFServerStream *stream, 
AVCodecContext *av,
 av_opt_set_dict2(av, opts, AV_OPT_SEARCH_CHILDREN);
 if (av_dict_count(*opts))
 av_log(NULL, AV_LOG_WARNING,
-   Something is wrong, %d options are not set!\n, 
av_dict_count(*opts));
+   Something is wrong, %d options are not set!\n,
+   av_dict_count(*opts));
 
 if (config-stream_use_defaults) {
 //TODO: reident
@@ -262,8 +264,8 @@ static void add_codec(FFServerStream *stream, 
AVCodecContext *av,
 if (!av_dict_get(recommended, rc_eq, NULL, 0)) {
 av-rc_eq = av_strdup(tex^qComp);
 av_dict_set(recommended, rc_eq, tex^qComp, 0);
-WARNING(Setting default value for video rate control equation = 
%s. 
-Use NoDefaults to disable it.\n,
+WARNING(Setting default value for video rate control equation = 
+%s. Use NoDefaults to disable it.\n,
 av-rc_eq);
 }
 if (!av_dict_get(recommended, maxrate, NULL, 0)) {
@@ -289,16 +291,19 @@ static void add_codec(FFServerStream *stream, 
AVCodecContext *av,
 switch(av-codec_type) {
 case AVMEDIA_TYPE_AUDIO:
 if (av-bit_rate == 0)
-report_config_error(config-filename, config-line_num, 
AV_LOG_ERROR,
-config-errors, audio bit rate is not 
set\n);
+report_config_error(config-filename, config-line_num,
+AV_LOG_ERROR, config-errors,
+audio bit rate is not set\n);
 if (av-sample_rate == 0)
-report_config_error(config-filename, config-line_num, 
AV_LOG_ERROR,
-config-errors, audio sample rate is not 
set\n);
+report_config_error(config-filename, config-line_num,
+AV_LOG_ERROR, config-errors,
+audio sample rate is not set\n);
 break;
 case AVMEDIA_TYPE_VIDEO:
 if (av-width == 0 || av-height == 0)
-report_config_error(config-filename, config-line_num, 
AV_LOG_ERROR,
-config-errors, video size is not 
set\n);
+report_config_error(config-filename, config-line_num,
+AV_LOG_ERROR, config-errors,
+video size is not set\n);
 break;
 default:
 av_assert0(0);
@@ -315,13 +320,15 @@ static void add_codec(FFServerStream *stream, 
AVCodecContext *av,
 stream-streams[stream-nb_streams++] = st;
 }
 
-static int ffserver_set_codec(AVCodecContext *ctx, const char *codec_name, 
FFServerConfig *config)
+static int ffserver_set_codec(AVCodecContext *ctx, const char *codec_name,
+  FFServerConfig *config)
 {
 int ret;
 AVCodec *codec = avcodec_find_encoder_by_name(codec_name);
 if (!codec || codec-type != ctx-codec_type) {
 report_config_error(config-filename, config-line_num, AV_LOG_ERROR,
-config-errors, Invalid codec name: '%s'\n, 
codec_name);
+config-errors,
+Invalid codec name: '%s'\n, codec_name);
 return 0;
 }
 if (ctx-codec_id == AV_CODEC_ID_NONE  !ctx-priv_data) {
@@ -330,8 +337,10 @@ static int ffserver_set_codec(AVCodecContext *ctx, const 
char *codec_name, FFSer
 ctx-codec = codec;
 }
 if (ctx-codec_id != codec-id)
-report_config_error(config-filename, config-line_num, AV_LOG_ERROR, 
config-errors,
-Inconsistent configuration: trying to set

[FFmpeg-cvslog] ffserver_config: improve error/warning messages

2014-12-08 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Mon Dec  8 14:12:36 2014 -0300| 
[b28d5877826c89cbf8b3f6ad9ba3e57307a2f33b] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver_config: improve error/warning messages

Fix grammar and quote user-supplied values.

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver_config.c |   71 +++--
 1 file changed, 36 insertions(+), 35 deletions(-)

diff --git a/ffserver_config.c b/ffserver_config.c
index 51e3f49..6c7b9b8 100644
--- a/ffserver_config.c
+++ b/ffserver_config.c
@@ -124,7 +124,7 @@ void ffserver_parse_acl_row(FFServerStream *stream, 
FFServerStream* feed,
 else if (av_strcasecmp(arg, deny) == 0)
 acl.action = IP_DENY;
 else {
-fprintf(stderr, %s:%d: ACL action '%s' is not ALLOW or DENY\n,
+fprintf(stderr, %s:%d: ACL action '%s' should be ALLOW or DENY.\n,
 filename, line_num, arg);
 errors++;
 }
@@ -163,7 +163,7 @@ void ffserver_parse_acl_row(FFServerStream *stream, 
FFServerStream* feed,
 else if (ext_acl)
 naclp = ext_acl;
 else {
-fprintf(stderr, %s:%d: ACL found not in stream or feed\n,
+fprintf(stderr, %s:%d: ACL found not in Stream or Feed\n,
 filename, line_num);
 errors++;
 }
@@ -321,7 +321,7 @@ static int ffserver_set_codec(AVCodecContext *ctx, const 
char *codec_name, FFSer
 AVCodec *codec = avcodec_find_encoder_by_name(codec_name);
 if (!codec || codec-type != ctx-codec_type) {
 report_config_error(config-filename, config-line_num, AV_LOG_ERROR,
-config-errors, Invalid codec name: %s\n, 
codec_name);
+config-errors, Invalid codec name: '%s'\n, 
codec_name);
 return 0;
 }
 if (ctx-codec_id == AV_CODEC_ID_NONE  !ctx-priv_data) {
@@ -331,7 +331,7 @@ static int ffserver_set_codec(AVCodecContext *ctx, const 
char *codec_name, FFSer
 }
 if (ctx-codec_id != codec-id)
 report_config_error(config-filename, config-line_num, AV_LOG_ERROR, 
config-errors,
-Inconsistent configuration: trying to set %s 
codec option, but %s codec is used previously\n,
+Inconsistent configuration: trying to set '%s' 
codec option, but '%s' codec is used previously\n,
 codec_name, avcodec_get_name(ctx-codec_id));
 return 0;
 }
@@ -543,7 +543,7 @@ static int ffserver_save_avoption(const char *opt, const 
char *arg, int type, FF
 o = av_opt_find(ctx, option, NULL, 0, 0);
 if (!o) {
 report_config_error(config-filename, config-line_num, AV_LOG_ERROR,
-config-errors, Option not found: %s\n, opt);
+config-errors, Option not found: '%s'\n, opt);
 if (!hinted  ctx-codec_id == AV_CODEC_ID_NONE) {
 hinted = 1;
 report_config_error(config-filename, config-line_num, 
AV_LOG_ERROR, NULL,
@@ -560,7 +560,7 @@ static int ffserver_save_avoption(const char *opt, const 
char *arg, int type, FF
 return av_dict_set(dict, option, arg, AV_DICT_APPEND);
 report_config_error(config-filename, config-line_num, AV_LOG_ERROR,
 config-errors,
-Redeclaring value of the option %s, previous value: %s\n,
+Redeclaring value of option '%s'. Previous value was: 
'%s'.\n,
 opt, e-value);
 } else if (av_dict_set(dict, option, arg, 0)  0) {
 return AVERROR(ENOMEM);
@@ -583,21 +583,21 @@ static int ffserver_parse_config_global(FFServerConfig 
*config, const char *cmd,
 char arg[1024];
 if (!av_strcasecmp(cmd, Port) || !av_strcasecmp(cmd, HTTPPort)) {
 if (!av_strcasecmp(cmd, Port))
-WARNING(Port option is deprecated, use HTTPPort instead\n);
+WARNING(Port option is deprecated. Use HTTPPort instead.\n);
 ffserver_get_arg(arg, sizeof(arg), p);
 ffserver_set_int_param(val, arg, 0, 1, 65535, config,
 Invalid port: %s\n, arg);
 if (val  1024)
-WARNING(Trying to use IETF assigned system port: %d\n, val);
+WARNING(Trying to use IETF assigned system port: '%d'\n, val);
 config-http_addr.sin_port = htons(val);
 } else if (!av_strcasecmp(cmd, HTTPBindAddress) || !av_strcasecmp(cmd, 
BindAddress)) {
 if (!av_strcasecmp(cmd, BindAddress))
-WARNING(BindAddress option is deprecated, use HTTPBindAddress 
instead\n);
+WARNING(BindAddress option is deprecated. Use HTTPBindAddress 
instead.\n);
 ffserver_get_arg(arg, sizeof(arg), p);
 if (resolve_host(config-http_addr.sin_addr, arg))
-ERROR(Invalid host/IP

[FFmpeg-cvslog] ffserver_config: reflow add_codec()

2014-12-08 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Mon Dec  8 18:32:22 2014 -0300| 
[720dffb843aa780d25b7be224c63ffc0aba13671] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver_config: reflow add_codec()

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver_config.c |   52 
 1 file changed, 28 insertions(+), 24 deletions(-)

diff --git a/ffserver_config.c b/ffserver_config.c
index d17b57e..017af48 100644
--- a/ffserver_config.c
+++ b/ffserver_config.c
@@ -195,13 +195,38 @@ static void add_codec(FFServerStream *stream, 
AVCodecContext *av,
 av_dict_copy(recommended, *opts, 0);
 av_opt_set_dict2(av-priv_data, opts, AV_OPT_SEARCH_CHILDREN);
 av_opt_set_dict2(av, opts, AV_OPT_SEARCH_CHILDREN);
+
 if (av_dict_count(*opts))
 av_log(NULL, AV_LOG_WARNING,
Something is wrong, %d options are not set!\n,
av_dict_count(*opts));
 
-if (config-stream_use_defaults) {
-//TODO: reident
+if (!config-stream_use_defaults) {
+switch(av-codec_type) {
+case AVMEDIA_TYPE_AUDIO:
+if (av-bit_rate == 0)
+report_config_error(config-filename, config-line_num,
+AV_LOG_ERROR, config-errors,
+audio bit rate is not set\n);
+if (av-sample_rate == 0)
+report_config_error(config-filename, config-line_num,
+AV_LOG_ERROR, config-errors,
+audio sample rate is not set\n);
+break;
+case AVMEDIA_TYPE_VIDEO:
+if (av-width == 0 || av-height == 0)
+report_config_error(config-filename, config-line_num,
+AV_LOG_ERROR, config-errors,
+video size is not set\n);
+break;
+default:
+av_assert0(0);
+}
+goto done;
+}
+
+/* stream_use_defaults = true */
+
 /* compute default parameters */
 switch(av-codec_type) {
 case AVMEDIA_TYPE_AUDIO:
@@ -287,29 +312,8 @@ static void add_codec(FFServerStream *stream, 
AVCodecContext *av,
 default:
 abort();
 }
-} else {
-switch(av-codec_type) {
-case AVMEDIA_TYPE_AUDIO:
-if (av-bit_rate == 0)
-report_config_error(config-filename, config-line_num,
-AV_LOG_ERROR, config-errors,
-audio bit rate is not set\n);
-if (av-sample_rate == 0)
-report_config_error(config-filename, config-line_num,
-AV_LOG_ERROR, config-errors,
-audio sample rate is not set\n);
-break;
-case AVMEDIA_TYPE_VIDEO:
-if (av-width == 0 || av-height == 0)
-report_config_error(config-filename, config-line_num,
-AV_LOG_ERROR, config-errors,
-video size is not set\n);
-break;
-default:
-av_assert0(0);
-}
-}
 
+done:
 st = av_mallocz(sizeof(AVStream));
 if (!st)
 return;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: drop pointless explicit !=0 checks

2014-11-16 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sun Nov 16 20:12:29 2014 -0300| 
[33d6f90e3e0241939ea0be9ca9e1f335942081c8] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: drop pointless explicit !=0 checks

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index ea2a2ae..933eb0e 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -1355,7 +1355,7 @@ static int http_parse_request(HTTPContext *c)
 redir_type = REDIR_ASX;
 filename[strlen(filename)-1] = 'f';
 } else if (av_match_ext(filename, asf) 
-(!useragent || av_strncasecmp(useragent, NSPlayer, 8) != 0)) {
+(!useragent || av_strncasecmp(useragent, NSPlayer, 8))) {
 /* if this isn't WMP or lookalike, return the redirector file */
 redir_type = REDIR_ASF;
 } else if (av_match_ext(filename, rpm,ram)) {
@@ -2303,7 +2303,7 @@ static int http_send_data(HTTPContext *c)
 ret = http_prepare_data(c);
 if (ret  0)
 return -1;
-else if (ret != 0)
+else if (ret)
 /* state change requested */
 break;
 } else {
@@ -2686,7 +2686,7 @@ static int rtsp_parse_request(HTTPContext *c)
 }
 
 /* check version name */
-if (strcmp(protocol, RTSP/1.0) != 0) {
+if (strcmp(protocol, RTSP/1.0)) {
 rtsp_reply_error(c, RTSP_STATUS_VERSION);
 goto the_end;
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver_config: add fixme on buffer_aggressivity/eq deprecation

2014-11-02 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sun Nov  2 22:10:54 2014 -0300| 
[33aacb775013a600f1e1bc26c6ca13fd5d92e959] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver_config: add fixme on buffer_aggressivity/eq deprecation

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver_config.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/ffserver_config.c b/ffserver_config.c
index 75998d1..c8180ef 100644
--- a/ffserver_config.c
+++ b/ffserver_config.c
@@ -214,6 +214,8 @@ static void add_codec(FFServerStream *stream, 
AVCodecContext *av)
 av-frame_skip_cmp = FF_CMP_DCTMAX;
 if (!av-me_method)
 av-me_method = ME_EPZS;
+
+/* FIXME: rc_buffer_aggressivity and rc_eq are deprecated */
 av-rc_buffer_aggressivity = 1.0;
 
 if (!av-rc_eq)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] libavfilter/af_amix: avoid derreferencing possible null

2014-09-26 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Fri Sep 26 16:37:28 2014 -0300| 
[a9ea79bb4976382b5648647013290ab61cf031e7] | committer: Reynaldo H. Verdejo 
Pinochet

libavfilter/af_amix: avoid derreferencing possible null

ff_all_channel_layouts() might return null on alloc failure.

Fixes CID1241516

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 libavfilter/af_amix.c |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c
index d8a6651..47cbb45 100644
--- a/libavfilter/af_amix.c
+++ b/libavfilter/af_amix.c
@@ -528,10 +528,17 @@ static av_cold void uninit(AVFilterContext *ctx)
 static int query_formats(AVFilterContext *ctx)
 {
 AVFilterFormats *formats = NULL;
+AVFilterChannelLayouts *layouts;
+
+layouts = ff_all_channel_layouts();
+
+if (!layouts)
+return AVERROR(ENOMEM);
+
 ff_add_format(formats, AV_SAMPLE_FMT_FLT);
 ff_add_format(formats, AV_SAMPLE_FMT_FLTP);
 ff_set_common_formats(ctx, formats);
-ff_set_common_channel_layouts(ctx, ff_all_channel_layouts());
+ff_set_common_channel_layouts(ctx, layouts);
 ff_set_common_samplerates(ctx, ff_all_samplerates());
 return 0;
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: drop custom skip_spaces() impl

2014-09-13 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sat Sep 13 20:52:03 2014 -0300| 
[2638af2fc5ec4b85d42ac381ed3f2fe7237e94e1] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: drop custom skip_spaces() impl

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |   13 +
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 3d42f62..24e4005 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -1258,24 +1258,13 @@ static int modify_current_stream(HTTPContext *c, char 
*rates)
 return action_required;
 }
 
-/* XXX: factorize in utils.c ? */
-/* XXX: take care with different space meaning */
-static void skip_spaces(const char **pp)
-{
-const char *p;
-p = *pp;
-while (*p == ' ' || *p == '\t')
-p++;
-*pp = p;
-}
-
 static void get_word(char *buf, int buf_size, const char **pp)
 {
 const char *p;
 char *q;
 
 p = *pp;
-skip_spaces(p);
+p += strspn(p, SPACE_CHARS);
 q = buf;
 while (!av_isspace(*p)  *p != '\0') {
 if ((q - buf)  buf_size - 1)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: use correct error for stream not found

2014-09-13 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Sat Sep 13 19:05:04 2014 -0300| 
[4c8be331bcd57559177559d9a704368a31126aa9] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: use correct error for stream not found

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 ffserver.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffserver.c b/ffserver.c
index dc7c5f2..3d42f62 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -3051,7 +3051,7 @@ static void rtsp_cmd_describe(HTTPContext *c, const char 
*url)
 }
 }
 /* no stream found */
-rtsp_reply_error(c, RTSP_STATUS_SERVICE); /* XXX: right error ? */
+rtsp_reply_error(c, RTSP_STATUS_NOT_FOUND);
 return;
 
  found:

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: tests, use image2 instead of pgmyuv

2014-08-31 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Mon Aug 25 12:24:02 2014 -0400| 
[b627385b4bd26bb45da5999fb12a8171fc224115] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: tests, use image2 instead of pgmyuv

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 tests/ffserver.conf |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/ffserver.conf b/tests/ffserver.conf
index 3612843..1e7a685 100644
--- a/tests/ffserver.conf
+++ b/tests/ffserver.conf
@@ -57,7 +57,7 @@ FileMaxSize 100M
 
 # Fire up ffmpeg pointing at this stream
 
-Launch ./ffmpeg -v 0 -y -f pgmyuv -i tests/vsynth1/%02d.pgm
+Launch ./ffmpeg -v 0 -y -f image2 -i tests/vsynth1/%02d.pgm
 
 ACL allow localhost
 /Feed

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: tests, use Metadata title in config

2014-08-24 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Fri Aug 22 18:29:18 2014 -0400| 
[07bc24973b8cf97dc52e69de236d06126740c55d] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: tests, use Metadata title in config

'Title' was deprecated with 9985710a5a927d52c345c4bdcc88f5c014ee2fe7

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 tests/ffserver.conf |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/ffserver.conf b/tests/ffserver.conf
index 05bd38f..3612843 100644
--- a/tests/ffserver.conf
+++ b/tests/ffserver.conf
@@ -173,7 +173,7 @@ PreRoll 10
 StartSendOnKey
 MaxTime 100
 
-Title Test data stream
+Metadata title Test data stream
 
 /Stream
 
@@ -195,7 +195,7 @@ PreRoll 20
 StartSendOnKey
 MaxTime 100
 
-Title Test data stream
+Metadata title Test data stream
 
 /Stream
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffserver: tests, use new port/bindaddress config

2014-08-24 Thread Reynaldo H. Verdejo Pinochet
ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet 
reyna...@osg.samsung.com | Wed Aug 20 00:49:38 2014 -0400| 
[d67d4072390d8db6520306e40795a75ee54e2b61] | committer: Reynaldo H. Verdejo 
Pinochet

ffserver: tests, use new port/bindaddress config

Comming from commit 1013d8dd6967f1e776c08dc133ed6ae44ca3dc64
the old Port and BindAddress config vars have been deprecated
in favor of HTTPPort and HTTPBindAddress respectively.

Signed-off-by: Reynaldo H. Verdejo Pinochet reyna...@osg.samsung.com

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

 tests/ffserver.conf |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/ffserver.conf b/tests/ffserver.conf
index 1e6994a..05bd38f 100644
--- a/tests/ffserver.conf
+++ b/tests/ffserver.conf
@@ -11,13 +11,13 @@
 # port from your standard http web server if it is running on the same
 # computer.
 
-Port 
+HTTPPort 
 RTSPPort 9990
 
 # Address on which the server is bound. Only useful if you have
 # several network interfaces.
 
-BindAddress 0.0.0.0
+HTTPBindAddress 0.0.0.0
 
 # Number of simultaneous requests that can be handled. Since FFServer
 # is very fast, this limit is determined mainly by your Internet

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog