From e28b7553aeab8aa0d590683a21a9a6ab113cb433 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Sat, 10 Nov 2012 18:10:59 +0100 Subject: [PATCH 1/7] configure: Add option to disable all command line programs --- configure | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 779b73327e..261b0ac217 100755 --- a/configure +++ b/configure @@ -101,12 +101,15 @@ Configuration options: --enable-gray enable full grayscale support (slower color) --disable-swscale-alpha disable alpha channel support in swscale -Component options: - --disable-doc do not build documentation +Program options: + --disable-programs do not build command line programs --disable-avconv disable avconv build --disable-avplay disable avplay build --disable-avprobe disable avprobe build --disable-avserver disable avserver build + +Component options: + --disable-doc do not build documentation --disable-avdevice disable libavdevice build --disable-avcodec disable libavcodec build --disable-avformat disable libavformat build @@ -1945,6 +1948,9 @@ for opt do ;; --enable-debug=*) debuglevel="$optval" ;; + --disable-programs) + disable $PROGRAM_LIST + ;; --disable-everything) map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST ;; From 116ae7285e2b5a9487b12c904b006c3c0063e83c Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Sun, 28 Oct 2012 00:43:12 +0200 Subject: [PATCH 2/7] doxygen: remove obsolete options from Doxyfile The options USE_INLINE_TREES, SHOW_DIRECTORIES and HTML_ALIGN_MEMBERS became obsolete with doxygen 1.8.1 (releaded 2012-05-19). The generated outpu for older doxygen versions should not change since they were set to the default value. --- doc/Doxyfile | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/doc/Doxyfile b/doc/Doxyfile index aa1f4e2947..1a37021c5b 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -489,12 +489,6 @@ MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = YES -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. @@ -848,12 +842,6 @@ HTML_COLORSTYLE_GAMMA = 80 HTML_TIMESTAMP = YES -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports @@ -1034,11 +1022,6 @@ ENUM_VALUES_PER_LINE = 4 GENERATE_TREEVIEW = NO -# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list. - -USE_INLINE_TREES = NO - # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. From 9eded0fe412e610ee8944681d5c554b723463e96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Tue, 13 Nov 2012 19:01:51 +0200 Subject: [PATCH 3/7] configure: Check for -Werror parameters on clang MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index 261b0ac217..14a887eaa2 100755 --- a/configure +++ b/configure @@ -3549,6 +3549,8 @@ elif enabled llvm_gcc; then elif enabled clang; then check_cflags -mllvm -stack-alignment=16 check_cflags -Qunused-arguments + check_cflags -Werror=implicit-function-declaration + check_cflags -Werror=missing-prototypes elif enabled armcc; then # 2523: use of inline assembler is deprecated add_cflags -W${armcc_opt},--diag_suppress=2523 From ada51a334aeb1e378fe852c8b5eede9cbbd05f69 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Wed, 25 Apr 2012 12:08:54 +0000 Subject: [PATCH 4/7] avserver: remove daemon mode This code spews a multitude of warnings with glibc (unchecked return values), some of them possibly warranted. Furthermore, the deamonisation is not suitable for use with typical startup scripts as it does not provide the PID of the daemon in any way. Users wishing to run avserver as a daemon can still do so using start-stop-daemon or equivalent tools. Signed-off-by: Mans Rullgard Signed-off-by: Janne Grunau --- Changelog | 1 + avserver.c | 38 -------------------------------------- doc/avserver.conf | 3 --- doc/avserver.texi | 8 +------- 4 files changed, 2 insertions(+), 48 deletions(-) diff --git a/Changelog b/Changelog index f8079d15fe..33e55a5f18 100644 --- a/Changelog +++ b/Changelog @@ -9,6 +9,7 @@ version : version 9_beta2: - metadata (INFO tag) support in WAV muxer - support for building DLLs using MSVC +- remove avserver daemon mode version 9_beta1: diff --git a/avserver.c b/avserver.c index f9d85d8d3e..649cbedbab 100644 --- a/avserver.c +++ b/avserver.c @@ -301,12 +301,10 @@ static int rtp_new_av_stream(HTTPContext *c, HTTPContext *rtsp_c); static const char *my_program_name; -static const char *my_program_dir; static const char *config_filename = "/etc/avserver.conf"; static int avserver_debug; -static int avserver_daemon; static int no_launch; static int need_to_start_children; @@ -524,9 +522,6 @@ static void start_children(FFStream *feed) } } - /* This is needed to make relative pathnames work */ - chdir(my_program_dir); - signal(SIGPIPE, SIG_DFL); execvp(pathname, feed->child_argv); @@ -4081,8 +4076,6 @@ static int parse_ffconfig(const char *filename) if (resolve_host(&my_http_addr.sin_addr, arg) != 0) { ERROR("%s:%d: Invalid host/IP address: %s\n", arg); } - } else if (!av_strcasecmp(cmd, "NoDaemon")) { - avserver_daemon = 0; } else if (!av_strcasecmp(cmd, "RTSPPort")) { get_arg(arg, sizeof(arg), &p); val = atoi(arg); @@ -4655,7 +4648,6 @@ static void handle_child_exit(int sig) static void opt_debug(void) { avserver_debug = 1; - avserver_daemon = 0; logfilename[0] = '-'; } @@ -4686,8 +4678,6 @@ int main(int argc, char **argv) show_banner(); my_program_name = argv[0]; - my_program_dir = getcwd(0, 0); - avserver_daemon = 1; parse_options(NULL, argc, argv, options, NULL); @@ -4719,37 +4709,9 @@ int main(int argc, char **argv) compute_bandwidth(); - /* put the process in background and detach it from its TTY */ - if (avserver_daemon) { - int pid; - - pid = fork(); - if (pid < 0) { - perror("fork"); - exit(1); - } else if (pid > 0) { - /* parent : exit */ - exit(0); - } else { - /* child */ - setsid(); - close(0); - open("/dev/null", O_RDWR); - if (strcmp(logfilename, "-") != 0) { - close(1); - dup(0); - } - close(2); - dup(0); - } - } - /* signal init */ signal(SIGPIPE, SIG_IGN); - if (avserver_daemon) - chdir("/"); - if (http_server() < 0) { http_log("Could not start server\n"); exit(1); diff --git a/doc/avserver.conf b/doc/avserver.conf index e9724bbf99..e1cd9fb126 100644 --- a/doc/avserver.conf +++ b/doc/avserver.conf @@ -25,9 +25,6 @@ MaxBandwidth 1000 # '-' is the standard output. CustomLog - -# Suppress that if you want to launch avserver as a daemon. -NoDaemon - ################################################################## # Definition of the live feeds. Each live feed contains one video diff --git a/doc/avserver.texi b/doc/avserver.texi index c023814e08..88e6221f6a 100644 --- a/doc/avserver.texi +++ b/doc/avserver.texi @@ -31,11 +31,6 @@ several live feeds, streaming from files and time shifting on live feeds (you can seek to positions in the past on each live feed, provided you specify a big enough feed storage in avserver.conf). -avserver runs in daemon mode by default; that is, it puts itself in -the background and detaches from its TTY, unless it is launched in -debug mode or a NoDaemon option is specified in the configuration -file. - This documentation covers only the streaming aspects of avserver / avconv. All questions about parameters for avconv, codec questions, etc. are not covered here. Read @file{avconv.html} for more @@ -257,8 +252,7 @@ within the various sections. Since avserver will not launch any avconv instances, you will have to launch them manually. @item -d Enable debug mode. This option increases log verbosity, directs log -messages to stdout and causes avserver to run in the foreground -rather than as a daemon. +messages to stdout. @end table @c man end From a4cd2ad89aa67533ff69de49612c747825c3f96f Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Thu, 25 Oct 2012 14:54:48 +0200 Subject: [PATCH 5/7] avserver: use freopen to redirect stdin/out/err to /dev/null --- avserver.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/avserver.c b/avserver.c index 649cbedbab..9f6b9d9405 100644 --- a/avserver.c +++ b/avserver.c @@ -25,6 +25,7 @@ #endif #include #include +#include #include "libavformat/avformat.h" // FIXME those are internal headers, avserver _really_ shouldn't use them #include "libavformat/ffm.h" @@ -513,13 +514,12 @@ static void start_children(FFStream *feed) close(i); if (!avserver_debug) { - i = open("/dev/null", O_RDWR); - if (i != -1) { - dup2(i, 0); - dup2(i, 1); - dup2(i, 2); - close(i); - } + 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;"); } signal(SIGPIPE, SIG_DFL); From c84cce5a99b85737154bf7559a4bf38593b54a75 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Fri, 26 Oct 2012 20:01:43 +0200 Subject: [PATCH 6/7] mxfdec: fix typo in mxf_read_seek() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Check the number of index tables before using byte offset based seeking instead of the index_tables pointer. Found by Måns Rullgård . --- libavformat/mxfdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 8595d72083..61b9c687e1 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -2210,7 +2210,7 @@ static int mxf_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti int ret; MXFIndexTable *t; - if (mxf->index_tables <= 0) { + if (mxf->nb_index_tables <= 0) { if (!s->bit_rate) return AVERROR_INVALIDDATA; if (sample_time < 0) From bf5f46b4cc47b7a4568119f224057d4ff91b6cdd Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Thu, 25 Oct 2012 16:26:06 +0200 Subject: [PATCH 7/7] APIChanges: add entry for av_read_packet deprecation --- doc/APIchanges | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/APIchanges b/doc/APIchanges index a0756da360..1c6247ef56 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -182,6 +182,10 @@ API changes, most recent first: 2012-04-05 - 5cc51a5 - lavu 51.26.0 - audioconvert.h Add av_get_default_channel_layout() +2012-03-20 - 3c90cc2 - lavfo 54.2.0 + Deprecate av_read_packet(), use av_read_frame() with + AVFMT_FLAG_NOPARSE | AVFMT_FLAG_NOFILLIN in AVFormatContext.flags + 2012-03-06 - 4d851f8 - lavu 51.25.0 - cpu.h Add av_set_cpu_flags_mask().