MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / read_key

Function read_key

ffmpeg.c:373–400  ·  view source on GitHub ↗

read a key without blocking */

Source from the content-addressed store, hash-verified

371
372/* read a key without blocking */
373static int read_key(void)
374{
375#if HAVE_TERMIOS_H
376 int n = 1;
377 unsigned char ch;
378#if !CONFIG_BEOS_NETSERVER
379 struct timeval tv;
380 fd_set rfds;
381
382 FD_ZERO(&rfds);
383 FD_SET(0, &rfds);
384 tv.tv_sec = 0;
385 tv.tv_usec = 0;
386 n = select(1, &rfds, NULL, NULL, &tv);
387#endif
388 if (n > 0) {
389 n = read(0, &ch, 1);
390 if (n == 1)
391 return ch;
392
393 return n;
394 }
395#elif HAVE_CONIO_H
396 if(kbhit())
397 return(getch());
398#endif
399 return -1;
400}
401
402static int decode_interrupt_cb(void)
403{

Callers 2

decode_interrupt_cbFunction · 0.85
av_transcodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected