[zaptel-commits] qwell: branch qwell/echocan-debug r2431 -
/team/qwell/echocan-debug/ztmonitor.c
zaptel-commits at lists.digium.com
zaptel-commits at lists.digium.com
Mon Apr 23 14:47:54 MST 2007
Author: qwell
Date: Mon Apr 23 16:47:54 2007
New Revision: 2431
URL: http://svn.digium.com/view/zaptel?view=rev&rev=2431
Log:
Support OSS output again. Of course, we still can't (currently) output non-combined streams.
It'll still stereorize (it's a real word now) the combined stream.
I'm not sure how it should work with multi-channel streams.
Modified:
team/qwell/echocan-debug/ztmonitor.c
Modified: team/qwell/echocan-debug/ztmonitor.c
URL: http://svn.digium.com/view/zaptel/team/qwell/echocan-debug/ztmonitor.c?view=diff&rev=2431&r1=2430&r2=2431
==============================================================================
--- team/qwell/echocan-debug/ztmonitor.c (original)
+++ team/qwell/echocan-debug/ztmonitor.c Mon Apr 23 16:47:54 2007
@@ -275,7 +275,7 @@
fprintf(stderr, " -v: Visual mode. Implies -m.\n");
fprintf(stderr, " -vv: Visual/Verbose mode. Implies -m.\n");
fprintf(stderr, " -m: Separate rx/tx streams.\n");
- fprintf(stderr, " -o: Output audio via OSS. Note: Only 'normal' rx/tx streams are output via OSS.\n");
+ fprintf(stderr, " -o: Output audio via OSS. Note: Only 'normal' combined rx/tx streams are output via OSS.\n");
fprintf(stderr, " -p: Get a pre-echocanceled stream.\n");
fprintf(stderr, " -f FILE: Save combined rx/tx stream to FILE. Cannot be used with -m.\n");
fprintf(stderr, " -r FILE: Save rx stream to FILE. Implies -m.\n");
@@ -360,11 +360,17 @@
preecho = 1;
}
}
+
if (ossoutput) {
- /* Open audio */
- if ((afd = audio_open()) < 0) {
- printf("Cannot open audio ...\n");
+ if (multichannel) {
+ printf("Multi-channel audio is enabled. OSS output will be disabled.\n");
ossoutput = 0;
+ } else {
+ /* Open audio */
+ if ((afd = audio_open()) < 0) {
+ printf("Cannot open audio ...\n");
+ ossoutput = 0;
+ }
}
}
if (!ossoutput && !multichannel && !savefile) {
@@ -495,15 +501,14 @@
}
}
- /* XXX This probably doesn't work with multichannel
if (ossoutput && afd) {
- if (stereo || multichannel) {
+ if (stereo) {
for (x=0;x<res;x++)
buf2[x<<1] = buf2[(x<<1) + 1] = buf[x];
write(afd, buf2, res << 1);
} else
write(afd, buf, res);
- } */
+ }
}
if (ofh[0]) fclose(ofh[0]);
if (ofh[1]) fclose(ofh[1]);
More information about the zaptel-commits
mailing list