diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-08-30 20:17:07 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-08-30 20:27:11 +0200 |
commit | e312543c82b493422911213ab792cb94f3a9e5b4 (patch) | |
tree | f70f53930135d8b4fd5da5ea54490a373d2121af /ffmpeg.c | |
parent | 3016c7f543a91490457b8a3d21ccef6fd5ff7226 (diff) | |
download | ffmpeg-e312543c82b493422911213ab792cb94f3a9e5b4.tar.gz |
ffmpeg: fix reading commands from stdin
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -2325,8 +2325,13 @@ static int transcode(OutputFile *output_files, if (key == 'c' || key == 'C'){ char ret[4096], target[64], cmd[256], arg[256]={0}; double ts; + int k; fprintf(stderr, "\nEnter command: <target> <time> <command>[ <argument>]\n"); - if(scanf("%4095[^\n\r]%*c", ret) == 1 && sscanf(ret, "%63[^ ] %lf %255[^ ] %255[^\n]", target, &ts, cmd, arg) >= 3){ + i=0; + while((k=read_key()) > 0 && k!='\n' && k!='\r' && i<sizeof(ret)-1) + ret[i++]= k; + ret[i]= 0; + if(k>0 && sscanf(ret, "%63[^ ] %lf %255[^ ] %255[^\n]", target, &ts, cmd, arg) >= 3){ for(i=0;i<nb_output_streams;i++) { int r; ost = &output_streams[i]; |