[FFmpeg-cvslog] ffsrever: Make the status page bitexact if any stream is bitexact
Michael Niedermayer
git at videolan.org
Tue Nov 29 20:27:32 EET 2016
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Tue Nov 29 19:05:43 2016 +0100| [606702ea348301e3daa97f578982f6614fa4c4bd] | committer: Michael Niedermayer
ffsrever: Make the status page bitexact if any stream is bitexact
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=606702ea348301e3daa97f578982f6614fa4c4bd
---
ffserver.c | 14 +++++++++-----
ffserver_config.c | 1 +
ffserver_config.h | 1 +
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/ffserver.c b/ffserver.c
index 9b1f6d5..20f5995 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -1987,7 +1987,9 @@ static void compute_status(HTTPContext *c)
sfilename, stream->filename);
avio_printf(pb, "<td align=right> %d <td align=right> ",
stream->conns_served);
- fmt_bytecount(pb, stream->bytes_served);
+ // TODO: Investigate if we can make http bitexact so it always produces the same count of bytes
+ if (!config.bitexact)
+ fmt_bytecount(pb, stream->bytes_served);
switch(stream->stream_type) {
case STREAM_TYPE_LIVE: {
@@ -2140,10 +2142,12 @@ static void compute_status(HTTPContext *c)
}
avio_printf(pb, "</table>\n");
- /* date */
- ti = time(NULL);
- p = ctime(&ti);
- avio_printf(pb, "<hr size=1 noshade>Generated at %s", p);
+ if (!config.bitexact) {
+ /* date */
+ ti = time(NULL);
+ p = ctime(&ti);
+ avio_printf(pb, "<hr size=1 noshade>Generated at %s", p);
+ }
avio_printf(pb, "</body>\n</html>\n");
len = avio_close_dyn_buf(pb, &c->pb_buffer);
diff --git a/ffserver_config.c b/ffserver_config.c
index 2354cc7..05c6622 100644
--- a/ffserver_config.c
+++ b/ffserver_config.c
@@ -1048,6 +1048,7 @@ static int ffserver_parse_config_stream(FFServerConfig *config, const char *cmd,
AV_OPT_FLAG_VIDEO_PARAM, config) < 0)
goto nomem;
} else if (!av_strcasecmp(cmd, "BitExact")) {
+ config->bitexact = 1;
if (ffserver_save_avoption("flags", "+bitexact", AV_OPT_FLAG_VIDEO_PARAM, config) < 0)
goto nomem;
} else if (!av_strcasecmp(cmd, "DctFastint")) {
diff --git a/ffserver_config.h b/ffserver_config.h
index 373767b..48d38dc 100644
--- a/ffserver_config.h
+++ b/ffserver_config.h
@@ -122,6 +122,7 @@ typedef struct FFServerConfig {
unsigned int nb_max_connections;
uint64_t max_bandwidth;
int debug;
+ int bitexact;
char logfilename[1024];
struct sockaddr_in http_addr;
struct sockaddr_in rtsp_addr;
More information about the ffmpeg-cvslog
mailing list