diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-11-30 16:02:04 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-11-30 16:02:04 +0000 |
commit | 4d0a7466320e54f45f413efef09ef8e6ad21bb3e (patch) | |
tree | 8b2d7d6dc4454b44aa23e189bf46dcee968964c3 /src/tests/procs.cpp | |
parent | ed402db706488ab910b7c810684379cc2d7b7662 (diff) | |
download | libbu++-4d0a7466320e54f45f413efef09ef8e6ad21bb3e.tar.gz libbu++-4d0a7466320e54f45f413efef09ef8e6ad21bb3e.tar.bz2 libbu++-4d0a7466320e54f45f413efef09ef8e6ad21bb3e.tar.xz libbu++-4d0a7466320e54f45f413efef09ef8e6ad21bb3e.zip |
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.
Diffstat (limited to 'src/tests/procs.cpp')
-rw-r--r-- | src/tests/procs.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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 @@ | |||
4 | 4 | ||
5 | int main( int agrc, char *argv[] ) | 5 | int main( int agrc, char *argv[] ) |
6 | { | 6 | { |
7 | Bu::Process p( argv[1], argv+1 ); | 7 | //Bu::Process p( argv[1], argv+1 ); |
8 | Bu::Process p("mplayer", "mplayer", "dvd://", "-framedrop", | ||
9 | "-ao", "null", "-nosound", "-vf", "framestep=I,cropdetect" "-sstep", | ||
10 | "197", NULL ); | ||
8 | 11 | ||
9 | char buf[1000]; | 12 | char buf[1000]; |
10 | for(;;) | 13 | for(;;) |
11 | { | 14 | { |
12 | int iSize = p.read( buf, 1000 ); | 15 | int iSize = p.read( buf, 1000 ); |
16 | printf("::read=%d::\n", iSize ); | ||
13 | if( iSize == 0 ) | 17 | if( iSize == 0 ) |
14 | break; | 18 | break; |
15 | fwrite( buf, iSize, 1, stdout ); | 19 | fwrite( buf, iSize, 1, stdout ); |