From b5c899ab5ec8ff89daf4d034f257dd0892625400 Mon Sep 17 00:00:00 2001 From: "Reynaldo H. Verdejo Pinochet" Date: Wed, 30 Nov 2016 10:28:16 -0800 Subject: [PATCH] ffserver: fix broken HTML on generated status page Dropped incompatible/obsoleted HTML tag attributes Signed-off-by: Reynaldo H. Verdejo Pinochet --- ffserver.c | 27 +++++++++++++-------------- tests/ffserver.regression.ref | 2 +- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/ffserver.c b/ffserver.c index d6b7b44be6..4e5ce1fc5b 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, "
PathServed
Conns

bytes
FormatBit rate
kbit/s
Video
kbit/s

Codec
Audio
kbit/s

Codec
Feed\n"); + avio_printf(pb, "\n"); + avio_printf(pb, "
PathServed
Conns

bytes
FormatBit rate
kbit/s
Video
kbit/s

Codec
Audio
kbit/s

Codec
Feed\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(&c1->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(&ti); - 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 3fdb6d6097..3106f8501a 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