[FFmpeg-cvslog] ffmpeg: fix read_yn() if HAVE_TERMIOS_H || HAVE_KBHIT == 0
Michael Niedermayer
git at videolan.org
Sat Oct 8 19:53:13 CEST 2011
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Oct 8 19:43:10 2011 +0200| [f3bacced244b90975ceb6e7c283413d34761e26c] | committer: Michael Niedermayer
ffmpeg: fix read_yn() if HAVE_TERMIOS_H || HAVE_KBHIT == 0
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f3bacced244b90975ceb6e7c283413d34761e26c
---
ffmpeg.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/ffmpeg.c b/ffmpeg.c
index 5e9fcf1..b290022 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -611,11 +611,13 @@ static int read_key(void)
static int read_yn(void)
{
- int c;
+ int c, t;
#if HAVE_TERMIOS_H || HAVE_KBHIT
while((c=read_key()) < 0);
#else
- c= getchar();
+ t=c= getchar();
+ while (t != '\n' && t != EOF)
+ t = getchar();
#endif
return (toupper(c) == 'Y');
More information about the ffmpeg-cvslog
mailing list