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.
On Tue, 19 Sep 2006 23:12:48 +0200 FoX <foxcore@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
On Tue, 19 Sep 2006 23:12:48 +0200 FoX <foxcore@gmail.com> wrote:
+ if (info_fifo_name && !strncmp(tmp, "ANS_", 4) ){
Why the heck do you limit the names to "ANS_*" ? And you forgot the man page patch ;) Attila Kinali -- egp ist vergleichbar mit einem ikea bausatz fuer flugzeugtraeger -- reeler in +kaosu
Hello, On Tue, Sep 19, 2006 at 11:12:48PM +0200, FoX wrote:
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.
I thought there was some similar but IIRC "cleaner" patch for something like that. Maybe it was even applied? Greetings, Reimar Döffinger
On Wed, 20 Sep 2006 22:44:09 +0200 Reimar Döffinger <Reimar.Doeffinger@stud.uni-karlsruhe.de> wrote:
Hello, On Tue, Sep 19, 2006 at 11:12:48PM +0200, FoX wrote:
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.
I thought there was some similar but IIRC "cleaner" patch for something like that. Maybe it was even applied?
yeah, i wrote some kinda event interface a while ago that does pretty much the same. hadn't reworked or updated it since (and no it wasn't applied). Ben -- "My life, and by extension everyone else's is meaningless." Bender, Futurama
2006/9/20, Benjamin Zores <ben@geexbox.org>:
open/close the fifo each time you wanna write to it is a bad idea.
OK. This new patch opens the infofifo right after config parsing and close it at mplayer exit. 2006/9/20, Attila Kinali <attila@kinali.ch>:
Why the heck do you limit the names to "ANS_*" ?
It also dumps everything that is outputed with mp_msg.
And you forgot the man page patch ;)
I'll do soon ;) 2006/9/20, Benjamin Zores <ben@geexbox.org>:
yeah, i wrote some kinda event interface a while ago that does pretty much the same. hadn't reworked or updated it since (and no it wasn't applied).
I didn't know you had done this kind of stuff Ben, and I would be happy to see your work.
participants (4)
-
Attila Kinali -
Benjamin Zores -
FoX -
Reimar Döffinger