[FFmpeg-trac] #42(FFmpeg:open): don't read stdin when running in a noninteractive shell

FFmpeg trac at avcodec.org
Wed Jun 22 12:17:52 CEST 2011


#42: don't read stdin when running in a noninteractive shell
---------------------------------------+---------------------
Reporter:  taeuber                     |       Owner:
    Type:  enhancement                 |      Status:  open
Priority:  wish                        |   Component:  FFmpeg
 Version:  git                         |  Resolution:
Keywords:  noninteractive shell stdin  |  Blocked By:
Blocking:                              |  Reproduced:  0
Analyzed:  0                           |
---------------------------------------+---------------------

Comment (by taeuber):

 Hi Michael,

 this is how I would implement it:

 {{{
 int interactive()
 {
     int fd, interactive;

     fd = open ("/dev/tty", O_RDONLY);
     if (fd < 0)
         return fd;

     interactive = (tcgetpgrp(fd) == getpgid(0));
     close (fd);
     return interactive;
 }
 }}}

 I have no idea about autoconf tools.

 But this doesn't solve the problem. It only tests foreground or background
 processing.
 Maybe an additional command line option would be the solution of choice?

 Lars

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/42#comment:4>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list