Signed-off-by: Luca Barbato <[email protected]>
---
Changelog | 1 +
avconv.c | 14 +++++++++++++-
doc/avconv.texi | 9 +++++++++
3 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/Changelog b/Changelog
index 7a2a7c8..e6c4b6f 100644
--- a/Changelog
+++ b/Changelog
@@ -25,6 +25,7 @@ version 10:
- support for WavPack muxing (raw and in Matroska)
- Go2Webinar decoder
- WavPack encoding through libwavpack
+- Interactive reporting
version 9:
diff --git a/avconv.c b/avconv.c
index 9fa0675..6d11e6a 100644
--- a/avconv.c
+++ b/avconv.c
@@ -127,13 +127,26 @@ sigterm_handler(int sig)
term_exit();
}
+static int64_t timer_start = 0;
+static void print_report(int is_last_report, int64_t timer_start);
+
+static void sigusr1_handler(int sig)
+{
+ print_report(1, timer_start);
+}
+
+
static void term_init(void)
{
+struct sigaction action;
+
signal(SIGINT , sigterm_handler); /* Interrupt (ANSI). */
signal(SIGTERM, sigterm_handler); /* Termination (ANSI). */
#ifdef SIGXCPU
signal(SIGXCPU, sigterm_handler);
#endif
+ action.sa_handler = sigusr1_handler;
+ sigaction(SIGUSR1, &action, NULL);
}
static int decode_interrupt_cb(void *ctx)
@@ -2177,7 +2190,6 @@ static int transcode(void)
AVFormatContext *os;
OutputStream *ost;
InputStream *ist;
- int64_t timer_start;
ret = transcode_init();
if (ret < 0)
diff --git a/doc/avconv.texi b/doc/avconv.texi
index 1842422..c438467 100644
--- a/doc/avconv.texi
+++ b/doc/avconv.texi
@@ -213,6 +213,15 @@ described.
@c man end STREAM SELECTION
+@chapter Reporting
+
+@c man begin REPORTING
+
+The conversion status is reported on stderror either every half second or, if
+using the option @code{-nostat}, when the signal USR1 is sent to the process.
+
+@c man end REPORTING
+
@chapter Options
@c man begin OPTIONS
--
1.8.2.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel