X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=ffmpeg.c;h=acaa523170fb475e00a6069cb3c52b5335975ead;hb=e7a39e163ddbde85f966132194143d0338445a0c;hp=977218f62aeb36fc1a312208580921001c63beab;hpb=56c71cd599862e02c4b579efe8eace376933efd4;p=ffmpeg diff --git a/ffmpeg.c b/ffmpeg.c index 977218f62ae..acaa523170f 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -369,8 +369,10 @@ static int read_key(void) } if (is_pipe) { /* When running under a GUI, you will end here. */ - if (!PeekNamedPipe(input_handle, NULL, 0, NULL, &nchars, NULL)) + if (!PeekNamedPipe(input_handle, NULL, 0, NULL, &nchars, NULL)) { + // input pipe may have been closed by the program that ran ffmpeg return -1; + } //Read it if(nchars != 0) { read(0, &ch, 1);