From 9a8ac0ead65670ee86ba30e7b5b82cc697c82df8 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 21 Jan 2017 15:38:04 +0100 Subject: blind-stack: the output video can be longer than the first input video MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/blind-stack.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/blind-stack.c b/src/blind-stack.c index 7093e93..2bcc38c 100644 --- a/src/blind-stack.c +++ b/src/blind-stack.c @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) { struct stream *streams; - size_t n_streams, i; + size_t n_streams, i, frames = 0, tmp; int blend = 0; void (*process)(struct stream *streams, size_t n_streams, size_t n) = NULL; @@ -67,6 +67,8 @@ main(int argc, char *argv[]) streams[i].file = argv[i]; streams[i].fd = eopen(streams[i].file, O_RDONLY); einit_stream(streams + i); + if (streams[i].frames > frames) + frames = streams[i].frames; } if (!strcmp(streams->pixfmt, "xyza")) @@ -74,8 +76,10 @@ main(int argc, char *argv[]) else eprintf("pixel format %s is not supported, try xyza\n", streams->pixfmt); + tmp = streams->frames, streams->frames = frames; fprint_stream_head(stdout, streams); efflush(stdout, ""); + streams->frames = tmp; process_multiple_streams(streams, n_streams, STDOUT_FILENO, "", process); free(streams); -- cgit v1.2.3-70-g09d2