From 4d0a7466320e54f45f413efef09ef8e6ad21bb3e Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 30 Nov 2007 16:02:04 +0000 Subject: Added some helpers to fstring, and fixed a bug in Bu::Process, it wasn't closing the pipes properly, resulting in the child process going defunct and not dying, it also wasn't buffering properly, it now collects as much data as it can before returning from a read operation. --- src/tests/procs.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/tests/procs.cpp') diff --git a/src/tests/procs.cpp b/src/tests/procs.cpp index 53e5142..c233040 100644 --- a/src/tests/procs.cpp +++ b/src/tests/procs.cpp @@ -4,12 +4,16 @@ int main( int agrc, char *argv[] ) { - Bu::Process p( argv[1], argv+1 ); + //Bu::Process p( argv[1], argv+1 ); + Bu::Process p("mplayer", "mplayer", "dvd://", "-framedrop", + "-ao", "null", "-nosound", "-vf", "framestep=I,cropdetect" "-sstep", + "197", NULL ); char buf[1000]; for(;;) { int iSize = p.read( buf, 1000 ); + printf("::read=%d::\n", iSize ); if( iSize == 0 ) break; fwrite( buf, iSize, 1, stdout ); -- cgit v1.2.3