[MPlayer-dev-eng] Slave commands output fifo

Benjamin Zores ben at geexbox.org
Wed Sep 20 20:27:20 CEST 2006


On Tue, 19 Sep 2006 23:12:48 +0200
FoX <foxcore at gmail.com> wrote:

> Hi all,
> 
> I'm working on a patch I'd like you to look at.
> For the GeeXboX project, we need to retrieve the output of slave
> commands with another way than parsing STDOUT.
> So here is a patch that adds support for an optional info_fifo
> parameter, where ANS_* informations are written.
> 
> Happy reviewing and thanks for your time.
> 

> +    if (info_fifo_name && !strncmp(tmp, "ANS_", 4) ){
> +        int fifo_fd = open(info_fifo_name, O_RDWR | O_NONBLOCK);
> +        if(fifo_fd >= 0){
> +          FILE* info_fifo = fdopen(fifo_fd, "w");
> +          if(info_fifo){
> +            fprintf(info_fifo, "%s", tmp);
> +            fclose(info_fifo);
> +         }
> +       }
> +    }

open/close the fifo each time you wanna write to it is a bad idea.

Ben

-- 
"My life, and by extension everyone else's is meaningless."
Bender, Futurama



More information about the MPlayer-dev-eng mailing list