commit 9a8ac0ead65670ee86ba30e7b5b82cc697c82df8
Author:     Mattias Andrée <[email protected]>
AuthorDate: Sat Jan 21 15:38:04 2017 +0100
Commit:     Mattias Andrée <[email protected]>
CommitDate: Sat Jan 21 15:38:04 2017 +0100

    blind-stack: the output video can be longer than the first input video
    
    Signed-off-by: Mattias Andrée <[email protected]>

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, "<stdout>");
+       streams->frames = tmp;
        process_multiple_streams(streams, n_streams, STDOUT_FILENO, "<stdout>", 
process);
 
        free(streams);

Reply via email to