1 diff -Naur wavplay-1.4/main.c wavplay-1.4-p/main.c
2 --- wavplay-1.4/main.c Sat Dec 4 01:06:42 1999
3 +++ wavplay-1.4-p/main.c Mon May 12 19:56:20 2003
5 printf("\t-%c\tLock for record.\n",OPF_RECD_LOCK);
6 printf("\t-%c\tUnlock for record.\n",OPF_RECD_UNLOCK);
7 printf("\t-%c dev\tOverride default of %s\n",OPF_DEVICE,AUDIODEV);
8 + printf("\t-%c\tOpen device in non-blocking mode.\n",OPF_NONBLOCK);
10 if ( opr_mode != OprRecord )
11 printf("\t-%c\tDisplay info about wav file(s) only\n",OPF_INFO);
13 OPF_INFO, OPF_HELP, OPF_QUIET, OPF_SAMPRATE,':', OPF_STEREO, OPF_MONO,
14 OPF_TIME,':', OPF_DATABITS,':', OPF_IPCKEY,':', OPF_RESET,
15 OPF_PLAY_LOCK, OPF_PLAY_UNLOCK, OPF_RECD_LOCK, OPF_RECD_UNLOCK,
16 - OPF_DEBUG, OPF_VERSION, OPF_DEVICE,':', 0 };
17 + OPF_DEBUG, OPF_VERSION, OPF_DEVICE,':', OPF_NONBLOCK, 0 };
18 #ifndef USE_GETOPT_STD
19 int optx; /* Option index */
22 case OPF_DEVICE : /* -d device_path */
23 env_AUDIODEV = optarg; /* Override environment variable */
26 + case OPF_NONBLOCK : /* -n ; non-blocking */
27 + wavopts.NonBlock.optChar = (char) optch;
30 case OPF_PLAY_LOCK : /* -l ; lock play lock request */
31 case OPF_PLAY_UNLOCK : /* -u ; unlock play lock request */
32 diff -Naur wavplay-1.4/recplay.c wavplay-1.4-p/recplay.c
33 --- wavplay-1.4/recplay.c Sat Dec 4 01:06:42 1999
34 +++ wavplay-1.4-p/recplay.c Mon May 12 19:58:29 2003
37 * If not -i mode, play the file:
39 - if ( (dfile = OpenDSP(wfile,O_WRONLY,v_erf)) == NULL )
40 + if ( (dfile = OpenDSP(wfile,O_WRONLY |
41 + (wavopts->NonBlock.optChar == OPF_NONBLOCK
43 + : 0) ,v_erf)) == NULL )
46 if ( PlayDSP(dfile,wfile,svr_work_proc,v_erf) )
47 diff -Naur wavplay-1.4/wavplay.1 wavplay-1.4-p/wavplay.1
48 --- wavplay-1.4/wavplay.1 Sat Dec 4 01:06:42 1999
49 +++ wavplay-1.4-p/wavplay.1 Mon May 12 19:59:44 2003
72 +use non-blocking open() call on device.
76 diff -Naur wavplay-1.4/wavplay.h wavplay-1.4-p/wavplay.h
77 --- wavplay-1.4/wavplay.h Mon May 12 19:42:44 2003
78 +++ wavplay-1.4-p/wavplay.h Mon May 12 19:54:59 2003
80 #define OPF_RECD_UNLOCK 'U' /* -U ; unlock record option */
81 #define OPF_DEBUG 'x' /* -x ; debug option */
82 #define OPF_VERSION 'V' /* -V ; version and copyright */
83 +#define OPF_NONBLOCK 'n' /* -n ; open in non-blocking mode */
86 * Types internal to wavplay, in an attempt to isolate ourselves from
88 UInt32 Seconds; /* Time limited to this many seconds, else zero */
89 UInt32 StartSample; /* Sample to start playback with */
90 int ipc; /* Semaphore IPC ID */
91 + FlgOpt NonBlock; /* -n option flag */