--- bplay-0.991.orig/bplay.1 +++ bplay-0.991/bplay.1 @@ -61,7 +61,10 @@ When recording, write Creative Labs VOC sound file. .TP .I "\-w" -When recording write Microsoft Wave sound file. +When recording write Microsoft Wave sound file. Note that the WAVE file format is limited to 4GiB filesize. Recording more data is possible, but the length info won't be consistent. +.TP +.I "\-q" +Quiet mode. No messages are displayed. .TP .I "\-D level" Print debug information to stderr. Debug level ranges from 0 to 2, @@ -89,4 +92,4 @@ The option parsing code was originally taken from .B vplay to maintain -compatability. +compatibility. --- bplay-0.991.orig/bplay.c +++ bplay-0.991/bplay.c @@ -5,13 +5,16 @@ ** ** */ +#define _FILE_OFFSET_BITS 64 +#define _LARGEFILE_SOURCE +#define _LARGEFILE64_SOURCE #include #include #include #include #include -#include +#include #include #include #include @@ -24,6 +27,30 @@ #include +/* Needed for BYTE_ORDER and BIG/LITTLE_ENDIAN macros. */ +#ifndef _BSD_SOURCE +# define _BSD_SOURCE +# include +# undef _BSD_SOURCE +#else +# include +#endif + +#include +#include + +/* Adapted from the byteorder macros in the Linux kernel. */ +#if BYTE_ORDER == LITTLE_ENDIAN +#define cpu_to_le32(x) (x) +#define cpu_to_le16(x) (x) +#else +#define cpu_to_le32(x) bswap_32((x)) +#define cpu_to_le16(x) bswap_16((x)) +#endif + +#define le32_to_cpu(x) cpu_to_le32((x)) +#define le16_to_cpu(x) cpu_to_le16((x)) + #include "fmtheaders.h" /* Types and constants */ @@ -39,6 +66,7 @@ pid_t pid; int recorder = 0; int debug = 0; +int verbose = 1; /* Prototypes */ @@ -52,10 +80,14 @@ void ErrDie(char *err); void Die(char *err); -void getbcount(int speed, int bits, int stereo, int *bcount, +void cleanup(int val, void *arg); + +void getbcount(int speed, int bits, int stereo, long long int *bcount, int timelim, int samplim, int timejmp, int sampjmp, int *bjump); -void playraw(int thefd, char hd_buf[20], int speed, int bits, int stereo); -void playwav(int thefd, char hd_buf[20], int mods, int speed, int bits, int stereo); +void playraw(int thefd, char hd_buf[20], int speed, int bits, int stereo, + int jump, int secs); +void playwav(int thefd, char hd_buf[20], int mods, int speed, int bits, + int stereo, int jump, int secs); void playvoc(int thefd, char hd_buf[20]); /* extern globals */ @@ -67,9 +99,9 @@ extern void init_sound(int recorder); extern void snd_parm(int speed, int bits, int stereo); extern void init_shm(void); -extern void shmrec(int outfd, int bcount, int terminate); -extern void diskread(int outfd, int bcount, char hd_buf[20], int terminate, - int speed, int bits, int stereo); +extern void shmrec(int outfd, long long int bcount, int terminate); +extern void diskread(int outfd, long long int bcount, char hd_buf[20], int terminate, + int speed, int bits, int stereo, int jump); extern volatile void audiowrite(void); extern void initsems(int disks, int snds); extern void cleanupsems(void); @@ -77,14 +109,14 @@ int main(int argc, char *argv[]) { - + int thefd; /* The file descriptor */ int speed, bits, stereo; /* Audio parameters */ int timelim; /* Recording time in secs */ int samplim; /* Recording time in samples */ int timejmp; /* Skip time in secs */ int sampjmp; /* Skip time in samples */ - int bcount; /* Number of bytes to record */ + long long int bcount; /* Number of bytes to record */ int bjump; /* Number of bytes to skip */ int themask; /* Permission mask for file */ sndf_t filetype; /* The file type */ @@ -110,7 +142,7 @@ filetype = F_UNKNOWN; mods = 0; /* Parse the options */ - while ((optc = getopt(argc, argv, "Ss:b:t:T:j:J:rvwd:B:D:")) != -1) + while ((optc = getopt(argc, argv, "Ss:b:t:T:j:J:rvwd:B:D:q")) != -1) { switch(optc) { @@ -142,6 +174,9 @@ case 'J': sampjmp = atoi(optarg); break; + case 'q': + verbose = 0; + break; case 'r': filetype = F_RAW; break; @@ -172,7 +207,7 @@ "%s: setpriority: %s: continuing anyway\n", progname, strerror(errno)); } - + #endif /* Drop out of suid mode before we open any files */ if(setreuid(geteuid(), getuid()) == -1) @@ -199,12 +234,12 @@ /* Ok, get the mask for the opening the file */ themask = umask(0); umask(themask); - if ((thefd = open(argv[optind], O_CREAT | O_TRUNC | O_WRONLY, + if ((thefd = open(argv[optind], O_CREAT | O_TRUNC | O_WRONLY | O_LARGEFILE, (~themask) & 0666)) == -1) ErrDie(argv[optind]); } else - if ((thefd = open(argv[optind], O_RDONLY)) == -1) + if ((thefd = open(argv[optind], O_RDONLY | O_LARGEFILE)) == -1) ErrDie(argv[optind]); } @@ -223,20 +258,21 @@ #endif /* Set up the shared buffers and semaphore blocks */ + on_exit(cleanup, 0); init_shm(); /* MUST be called after init_sound() */ /* Call the appropriate routine */ if (recorder) { if ((timelim == 0) && (samplim == 0)) { - bcount = INT_MAX; + bcount = INT64_MAX - 1; } else { getbcount(speed, bits, stereo, &bcount, timelim, samplim, timejmp, sampjmp, &bjump); } if (debug) - fprintf(stderr, "bcount: %d\n", bcount); + fprintf(stderr, "bcount: %lld\n", bcount); if (filetype == F_UNKNOWN) filetype = F_RAW; /* Change to change default */ @@ -244,9 +280,11 @@ { case F_WAV: /* Spit out header here... */ - fprintf(stderr, "Writing MS WAV sound file"); + if (verbose) + fprintf(stdout, "Writing MS WAV sound file"); { wavhead header; + unsigned long long int tmp; char *riff = "RIFF"; char *wave = "WAVE"; @@ -254,34 +292,45 @@ char *data = "data"; memcpy(&(header.main_chunk), riff, 4); - header.length = sizeof(wavhead) - 8 + bcount; + if ( (tmp = sizeof(wavhead) - 8 + bcount) >> 32 ) { + header.length = 0xFFFFFFFF; // do not overload the header + fprintf(stderr, " (WARNING: Resulting file size is larger than 4GiB, violating the WAVE format specification!)"); + } + else + header.length = cpu_to_le32(tmp); + memcpy(&(header.chunk_type), wave, 4); memcpy(&(header.sub_chunk), fmt, 4); - header.sc_len = 16; - header.format = 1; - header.modus = stereo + 1; - header.sample_fq = speed; - header.byte_p_sec = ((bits > 8)? 2:1)*(stereo+1)*speed; - header.byte_p_spl = ((bits > 8)? 2:1)*(stereo+1); - header.bit_p_spl = bits; + header.sc_len = cpu_to_le32(16); + header.format = cpu_to_le16(1); + header.modus = cpu_to_le16(stereo + 1); + header.sample_fq = cpu_to_le32(speed); + header.byte_p_sec = cpu_to_le32(((bits > 8)? + 2:1)*(stereo+1)*speed); + header.byte_p_spl = cpu_to_le16(((bits > 8)? + 2:1)*(stereo+1)); + header.bit_p_spl = cpu_to_le16(bits); memcpy(&(header.data_chunk), data, 4); - header.data_length = bcount; + header.data_length = ( bcount >> 32 ) ? 0xFFFFFFFF : cpu_to_le32(bcount) ; //FIXME see above, make sure that it works cleanly write(thefd, &header, sizeof(header)); } case F_RAW: if (filetype == F_RAW) - fprintf(stderr, "Writing raw sound file"); - fprintf(stderr, ", %dHz, %dbit, %s\n", speed, bits, (stereo)? "stereo":""); + if (verbose) { + fprintf(stdout, "Writing raw sound file"); + fprintf(stdout, ", %dHz, %dbit, %s\n", speed, bits, (stereo)? "stereo":""); + } snd_parm(speed, bits, stereo); initsems(0, 1); shmrec(thefd, bcount, 1); break; case F_VOC: /* Spit out header here... */ - fprintf(stderr, "Writing CL VOC sound file"); - fprintf(stderr, ", %dHz, %dbit, %s\n", speed, bits, (stereo)? "stereo":""); + if (verbose) { + fprintf(stdout, "Writing CL VOC sound file"); + fprintf(stdout, ", %dHz, %dbit, %s\n", speed, bits, (stereo)? "stereo":"");} { vochead header; blockTC ablk; @@ -291,23 +340,29 @@ for (i=0;i<20;i++) header.Magic[i] = VOC_MAGIC[i]; - header.BlockOffset = 0x1a; - header.Version = 0x0114; - header.IDCode = 0x111F; + header.BlockOffset = cpu_to_le16(0x1a); + header.Version = cpu_to_le16(0x0114); + header.IDCode = cpu_to_le16(0x111F); write(thefd, &header, sizeof(vochead)); snd_parm(speed, bits, stereo); initsems(0, 1); - i = (bcount >= 0xFFFFF2)? 0xFFFFF2 + 12 : bcount; + i = bcount; + if (bcount >= 0xFFFFF2) + { + i = 0xFFFFF2 + 12; + fprintf(stderr, "Warning: length is out of allowed range, consider using another sound format!\n"); + } + ablk.BlockID = 9; ablk.BlockLen[0] = (i + 12) & 0xFF; ablk.BlockLen[1] = ((i + 12) >> 8) & 0xFF; ablk.BlockLen[2] = ((i + 12) >> 16) & 0xFF; - bblk.SamplesPerSec = speed; + bblk.SamplesPerSec = cpu_to_le32(speed); bblk.BitsPerSample = bits; bblk.Channels = stereo + 1; - bblk.Format = (bits == 8)? 0 : 4; + bblk.Format = cpu_to_le16((bits == 8)? 0 : 4); write(thefd, &ablk, sizeof(ablk)); write(thefd, &bblk, sizeof(bblk)); shmrec(thefd, i, 1); @@ -338,9 +393,18 @@ if(strstr(hd_buf, VOC_MAGIC) != NULL) playvoc(thefd, hd_buf); else if(strstr(hd_buf, "RIFF") != NULL) - playwav(thefd, hd_buf, mods, speed, bits, stereo); + { + if (sampjmp) + playwav(thefd, hd_buf, mods, speed, bits, stereo, sampjmp, 0); + else + playwav(thefd, hd_buf, mods, speed, bits, stereo, timejmp, 1); + } else /* Assume raw data */ - playraw(thefd, hd_buf, speed, bits, stereo); + if (sampjmp) + playraw(thefd, hd_buf, speed, bits, stereo, sampjmp, 0); + else + playraw(thefd, hd_buf, speed, bits, stereo, timejmp, 1); + wait(NULL); cleanupsems(); @@ -352,7 +416,7 @@ void Usage(void) { fprintf(stderr, - "Usage: %s [-d device] [-B buffersize] [-S] [-s Hz] [-b 8|16] [-t secs] [-D level] [-r|-v|-w] [filename]\n", + "Usage: %s [-d device] [-B buffersize] [-S] [-s Hz] [-b 8|16] [-t secs] [-q] [-D level] [-r|-v|-w] [filename]\n", progname); exit(1); } @@ -370,12 +434,17 @@ exit(-1); } -void getbcount(int speed, int bits, int stereo, int *bcount, +void cleanup(int val, void *arg) +{ + cleanupsems(); +} + +void getbcount(int speed, int bits, int stereo, long long int *bcount, int timelim, int samplim, int timejmp, int sampjmp, int *bjump) { if(timelim) { - *bcount = speed*timelim*(bits/8); + *bcount = (long long) speed * (long long) timelim * (bits/8); if (stereo) *bcount <<= 1; } if(samplim) @@ -395,14 +464,20 @@ } } -void playraw(int thefd, char hd_buf[20], int speed, int bits, int stereo) +void playraw(int thefd, char hd_buf[20], int speed, int bits, int stereo, int jump, int secs) { - fprintf(stderr, "Playing raw data : %d bit, Speed %d %s ...\n", - bits, speed, (stereo)? "Stereo" : "Mono"); - diskread(thefd, 0, hd_buf, 1, speed, bits, stereo); + if (verbose) { + fprintf(stdout, "Playing raw data : %d bit, Speed %d %s ...\n", + bits, speed, (stereo)? "Stereo" : "Mono"); + } + + if (secs == 0) + jump = jump / speed; + + diskread(thefd, 0, hd_buf, 1, speed, bits, stereo, jump); } -void playwav(int thefd, char hd_buf[20], int mods, int speed, int bits, int stereo) +void playwav(int thefd, char hd_buf[20], int mods, int speed, int bits, int stereo, int jump, int secs) { wavhead wavhd; int count; @@ -410,24 +485,20 @@ memcpy((void*)&wavhd, (void*)hd_buf, 20); count = read(thefd, ((char*)&wavhd)+20, sizeof(wavhd) - 20); -#if __BYTE_ORDER == __BIG_ENDIAN -#include - /* let's do a bit of reordering */ - wavhd.length = bswap_32 (wavhd.length); - wavhd.sc_len = bswap_32 (wavhd.sc_len); - wavhd.format = bswap_16 (wavhd.format); - wavhd.modus = bswap_16 (wavhd.modus); - - wavhd.sample_fq = bswap_32 (wavhd.sample_fq); - wavhd.byte_p_sec = bswap_32 (wavhd.byte_p_sec); - - wavhd.byte_p_spl = bswap_16 (wavhd.byte_p_spl); - wavhd.bit_p_spl = bswap_16 (wavhd.bit_p_spl); - - wavhd.data_chunk = bswap_32 (wavhd.data_chunk); - wavhd.data_length = bswap_32 (wavhd.data_length); -#endif - +wavhd.length = le32_to_cpu (wavhd.length); +wavhd.sc_len = le32_to_cpu (wavhd.sc_len); +wavhd.format = le16_to_cpu (wavhd.format); +wavhd.modus = le16_to_cpu (wavhd.modus); + +wavhd.sample_fq = le32_to_cpu (wavhd.sample_fq); +wavhd.byte_p_sec = le32_to_cpu (wavhd.byte_p_sec); + +wavhd.byte_p_spl = le16_to_cpu (wavhd.byte_p_spl); +wavhd.bit_p_spl = le16_to_cpu (wavhd.bit_p_spl); + +wavhd.data_chunk = le32_to_cpu (wavhd.data_chunk); +wavhd.data_length = le32_to_cpu (wavhd.data_length); + if(wavhd.format != 1) Die("input is not a PCM WAV file"); if (! (mods&MSPEED)) speed = wavhd.sample_fq; @@ -435,9 +506,15 @@ bits = wavhd.bit_p_spl; if (! (mods&MSTEREO)) stereo = wavhd.modus - 1; - fprintf(stderr, "Playing WAVE : %d bit, Speed %d %s ...\n", + if (verbose) { + fprintf(stdout, "Playing WAVE : %d bit, Speed %d %s ...\n", bits, speed, (stereo)? "Stereo" : "Mono"); - diskread(thefd, 0, NULL, 1, speed, bits, stereo); + } + + if (secs == 0) + jump = jump / speed; + + diskread(thefd, 0, NULL, 1, speed, bits, stereo, jump); } void playvoc(int thefd, char hd_buf[20]) @@ -445,17 +522,24 @@ int count; int speed=0, bits=0, stereo=0; int inloop=0, loop_times; - long bytecount, loop_pos=0; + long long bytecount, loop_pos=0; vochead vochd; blockTC ccblock; int lastblocktype = -1; int quit = 0; - fprintf(stderr, "Playing Creative Labs Voice file ...\n"); + if (verbose) fprintf(stdout, "Playing Creative Labs Voice file ...\n"); memcpy((void*)&vochd, (void*)hd_buf, 20); count = read(thefd, ((char*)&vochd)+20, sizeof(vochd) - 20); - fprintf(stderr, "Format version %d.%d\n", vochd.Version>>8, + + vochd.BlockOffset = le16_to_cpu(vochd.BlockOffset); + vochd.Version = le16_to_cpu(vochd.Version); + vochd.IDCode = le16_to_cpu(vochd.IDCode); + + if (verbose) { + fprintf(stdout, "Format version %d.%d\n", vochd.Version>>8, vochd.Version&0xFF); + } if (vochd.IDCode != (~vochd.Version+0x1234)) fprintf(stderr, "Odd - version mismatch - %d != %d\n", vochd.IDCode, ~vochd.Version+0x1234); @@ -463,7 +547,7 @@ { int off = vochd.BlockOffset - sizeof(vochd); char *junk; - junk = (char*) malloc(off); + junk = (char*) malloc(off); read(thefd, junk, off); } while(!quit) @@ -473,7 +557,7 @@ if (debug) fprintf(stderr, "Terminating\n"); - diskread(thefd, -1, NULL, 1, speed, bits, stereo); + diskread(thefd, -1, NULL, 1, speed, bits, stereo, 0); quit = 1; continue; } @@ -494,7 +578,7 @@ stereo = 0; } bytecount = DATALEN(ccblock) -2; - diskread(thefd, bytecount, NULL, 0, speed, bits, stereo); + diskread(thefd, bytecount, NULL, 0, speed, bits, stereo, 0); lastblocktype = 1; } break; @@ -502,6 +586,9 @@ { blockT8 tblock; read(thefd, (char*)&tblock, sizeof(tblock)); + + tblock.TimeConstant = le16_to_cpu(tblock.TimeConstant); + if(tblock.PackMethod != 0) Die("Non PCM VOC block"); speed = 256000000/(65536 - tblock.TimeConstant); bits = 8; @@ -514,13 +601,17 @@ { blockT9 tblock; read(thefd, (char*)&tblock, sizeof(tblock)); + + tblock.SamplesPerSec = le32_to_cpu(tblock.SamplesPerSec); + tblock.Format = le16_to_cpu(tblock.Format); + if(tblock.Format != 0 && tblock.Format != 4) Die("Non PCM VOC block"); speed = tblock.SamplesPerSec; bits = tblock.BitsPerSample; stereo = tblock.Channels - 1; bytecount = DATALEN(ccblock) - 12; - diskread(thefd, bytecount, NULL, 0, speed, bits, stereo); + diskread(thefd, bytecount, NULL, 0, speed, bits, stereo, 0); lastblocktype = 9; } break; @@ -528,7 +619,7 @@ if (debug) fprintf(stderr, "Terminating\n"); - diskread(thefd, -1, NULL, 1, speed, bits, stereo); + diskread(thefd, -1, NULL, 1, speed, bits, stereo, 0); quit = 1; break; case 6: @@ -568,11 +659,11 @@ { int rd = 0, trgt = BUFSIZ; char junkbuf[BUFSIZ]; - + fprintf(stderr, "Ignored\n"); bytecount = DATALEN(ccblock); while(rd < bytecount) - { + {//FIXME rd, trgt, not sure what this has to do with bytecount if (rd + trgt > bytecount) trgt = bytecount - rd; count = read(thefd, junkbuf, trgt); --- bplay-0.991.orig/debian/bplay.docs +++ bplay-0.991/debian/bplay.docs @@ -0,0 +1 @@ +README --- bplay-0.991.orig/debian/bplay.install +++ bplay-0.991/debian/bplay.install @@ -0,0 +1 @@ +bplay usr/bin --- bplay-0.991.orig/debian/bplay.links +++ bplay-0.991/debian/bplay.links @@ -0,0 +1 @@ +usr/bin/bplay usr/bin/brec --- bplay-0.991.orig/debian/changelog +++ bplay-0.991/debian/changelog @@ -0,0 +1,280 @@ +bplay (0.991-10.1) unstable; urgency=medium + + * Non-maintainer upload. + * Using new DH level format. Consequently: + - debian/compat: removed. + - debian/control: changed from 'debhelper' to 'debhelper-compat' in + Build-Depends field and bumped level to 13. + - Closes: #965440 + * debian/rules: added missing targets build-arch and build-indep. + (Closes: #999139) + + -- Joao Eriberto Mota Filho Sat, 16 Apr 2022 16:32:45 -0300 + +bplay (0.991-10) unstable; urgency=low + + * Install the manpages. (Closes: #327759) + * debian/copyright: download location is gone, so just removing it for now. + * bplay.1: fixed minor typo. (Closes: #307033) + * debian/control: Standards-Version bumped to 3.7.2.2. + * debian/compat: created, compatible with debhelper V5. + * debian/control: Build-Depends on debhelper >> 5.0.0 now. + * debian/rules: no longer ignore the result of 'make clean', removes + binary-indep target, and uses dh_install now. + + -- Carlos Laviola Thu, 27 Sep 2007 20:51:21 -0300 + +bplay (0.991-9) unstable; urgency=low + + * Applied patch sent to gramofile (#292137), which has a forked bplay + codebase, that hopefully fixes our endianness and byteswapping problems. + * Implemented a quiet mode option (Closes: #119077). + * Informational messages are now sent to stdout instead of stderr. + (Closes: #228668) + + -- Carlos Laviola Wed, 4 May 2005 00:39:17 -0300 + +bplay (0.991-8) unstable; urgency=low + + * Set maintainer to the Debian QA Group , as I'm + leaving the project. Kudos to all who remain and those that will still + come. + + -- Carlos Laviola Fri, 5 Mar 2004 18:32:03 -0300 + +bplay (0.991-7) unstable; urgency=low + + * Applied patch by Alexandre Belloni , which complements + the LFS patch by Eduard Bloch and makes bplay work again. + (Closes: #193388, #193714) + + -- Carlos Laviola Sat, 7 Jun 2003 00:39:14 -0300 + +bplay (0.991-6) unstable; urgency=low + + * Added LFS support, since upstream is MIA, thanks to Eduard Bloch. + (Closes: #64962) + + -- Carlos Laviola Sun, 11 May 2003 13:22:35 -0300 + +bplay (0.991-5) unstable; urgency=low + + * Applied a couple of patches from Edmund GRIMLEY EVANS + which should fix a couple of bugs. Thanks, Edmund. (Closes: #83347, #84904) + + -- Carlos Laviola Thu, 21 Feb 2002 20:11:40 -0300 + +bplay (0.991-4) unstable; urgency=low + + * Changed my e-mail from claviola@ajato.com.br to claviola@debian.org + in all my packages. + + -- Carlos Laviola Wed, 30 May 2001 16:34:08 -0300 + +bplay (0.991-3) unstable; urgency=low + + * New maintainer. (Closes: #91297) + * Upped Standards-Version to 3.5.4 + * Made a few cosmetic changes to debian/copyright + + -- Carlos Laviola Fri, 25 May 2001 21:17:22 -0300 + +bplay (0.991-2) unstable; urgency=low + + * Added build-depends (Closes #70298) + * Added patch from #80007 to enable -j/-J options. (Closes: #80007) + patch by andy@sharinga.com + + -- Peter Makholm Wed, 20 Dec 2000 22:51:16 +0100 + +bplay (0.991-1) unstable; urgency=low + + * New upstream + + -- Peter Makholm Tue, 26 Sep 2000 08:30:08 +0200 + +bplay (0.99-2) unstable frozen; urgency=low + + * Fixed endianess issue with wav-files (Closes: #60041) + - This patch does only affect bigendian machines, where bplay obvious + didn't work before but should do now + + -- Peter Makholm Mon, 13 Mar 2000 11:06:22 +0100 + +bplay (0.99-1) unstable frozen; urgency=low + + * New upstream version + The only changes in this version is my previous fixes to bplay and + a one-line fix to a bug. + * Should fix problems with ES1370 (Closes: #57193) + This is the one-line fix. + * Removed "audio/basic"-MIME entry (Closes: #57193) + + -- Peter Makholm Tue, 7 Mar 2000 14:24:41 +0100 + +bplay (0.98-7) unstable; urgency=low + + * Small changes to make it 64-bit clean + * Wrote a README.Debian documenting changes from upstream + + -- Peter Makholm Wed, 12 Jan 2000 22:28:10 +0100 + +bplay (0.98-6) unstable; urgency=low + + * Added file format switches to man page (Closes: #53577) + + -- Peter Makholm Thu, 30 Dec 1999 05:43:19 +0100 + +bplay (0.98-5) unstable; urgency=low + + * Added switch to write debug information + + -- Peter Makholm Thu, 9 Dec 1999 21:54:01 +0100 + +bplay (0.98-4) unstable; urgency=low + + * The previous version was not accepted by dinstall + * Very minor packaging cleanups + * Fixes compiler errors + + -- Peter Makholm Mon, 6 Dec 1999 23:32:40 +0100 + +bplay (0.98-3) unstable; urgency=low + + * Changed low limit on audio buffer size. (Closes: #48127) + + -- Peter Makholm Tue, 9 Nov 1999 23:52:14 +0100 + +bplay (0.98-2) unstable; urgency=low + + * Removed some debugging messages + * Resets audio on SIGINT (closes: #24487) + + -- Peter Makholm Mon, 18 Oct 1999 21:54:53 +0200 + +bplay (0.98-1) unstable; urgency=low + + * New upstream version + + -- Peter Makholm Sun, 26 Sep 1999 10:42:54 +0200 + +bplay (0.96-10) unstable; urgency=low + + * Fixes brec + * Bugfixes for #21623, #21642 and #37478 tested + * Don't compile with -DDEBUG + * Cosmetic changes in debian/rules + + -- Peter Makholm Sat, 18 Sep 1999 22:45:49 +0200 + +bplay (0.96-9) unstable; urgency=low + + * Fixes bug with long records (#21623, #21642, #37478) + patch by Riku Saikkonen (rjs@isil.lloke.dna.fi) + * Fixes wrong RIFF header (#11562) + patch in bug report by lebrun@hermes.kawo1.rwth-aarchen.de + * Kill a second process on error (#15779, #16180, #35007) + * We don't play AU and have never done it. (#32540) + * Standard-Version: 3.0.1 + + -- Peter Makholm Mon, 2 Aug 1999 21:43:12 +0200 + +bplay (0.96-8) unstable; urgency=low + + * New maintainer + * Uses update-mime (close #26741) + * Include diffs from Paul Slootman (close #28010) + - 4th arg for semctl() is a union, not an int + * Fixed layout in man page (part of #21623) + + -- Peter Makholm Wed, 26 May 1999 22:31:08 +0200 + +bplay (0.96-7) frozen unstable; urgency=high + + * New maintainer + * Removed suid from the binary. This is not needed, and is a possible + security risk. Furthermore, it allowed any user on the system to play + sound, and maybe even spy on you by recording from the microphone! + Instead people allowed to this should be in group sound. + + -- Norbert Veber Sat, 13 Jun 1998 22:21:00 -0500 + +bplay (0.96-6) frozen unstable; urgency=low + + * mime-support call: we are bplay, not playmidi + + -- Wichert Akkerman Tue, 17 Mar 1998 18:36:25 +0100 + +bplay (0.96-5) unstable; urgency=low + + * call dh_suidregister + + -- Wichert Akkerman Sun, 15 Mar 1998 23:15:07 +0100 + +bplay (0.96-4) unstable; urgency=low + + * Allow other audio devices (Bug# 19650) + * Allow user to specify buffer sizes (Bug# 19650) + * Switched to debhelpher (Bug# 18693) + * Fixed copyright (lintian) + * Fixed type in manualpage (Bug# 19080) + * Register with mime-support (Bug# 18692) + + -- Wichert Akkerman Sun, 15 Mar 1998 22:48:17 +0100 + +bplay (0.96-3) unstable; urgency=low + + * Removed -m486 from compile options (Bug# 13664) + * Removed debugging code + * Pristine sources + * libc6 / glibc build + * Check if we are root before trying to lock a buffer or set priority + * No longer use debmake + + -- Wichert Akkerman Tue, 7 Oct 1997 13:55:58 +0200 + +bplay (0.96-2) unstable; urgency=LOW + + * Added dependencies to control file for libc + + -- Wichert Akkerman Mon, 14 Jul 1997 01:13:00 +0200 + +bplay (0.96-1) unstable; urgency=LOW + + * New upstream version + + -- Wichert Akkerman Mon, 10 Feb 1997 21:29:41 +0100 + +bplay (0.95-5) unstable; urgency=LOW + + * Moved to debmake + * Fixed double-speed playing bug. Patch by author. + + -- Wichert Akkerman Sun, 19 Jan 1997 23:45:55 +0100 + +bplay (0.95-4) unstable; urgency=LOW + + * Made copyright a symlink to /usr/doc/copyright/GPL + * Renamed debian changelog to changelog.Debian + * Compress manpages + + -- Wichert Akkerman Sat, 26 Oct 1996 18:36:12 +0200 + +bplay (0.95-3) unstable; urgency=low + + * Moved to new packaging format + + -- Wichert Akkerman Sun, 22 Sep 1996 01:05:44 +0200 + +bplay (0.95-2); priority=LOW + + * New maintainer: Wichert Akkerman + * Added extra include to prevent a compiler warning + + -- Wichert Akkerman Thu Jul 11 21:44:06 MET DST 1996 + +bplay (0.95-1) unstable; urgency=low + + * Initial Release. + + -- Wichert Akkerman Sun, 19 Jan 1997 23:43:46 +0100 --- bplay-0.991.orig/debian/control +++ bplay-0.991/debian/control @@ -0,0 +1,21 @@ +Source: bplay +Section: sound +Priority: optional +Maintainer: Carlos Laviola +Build-Depends: debhelper-compat (= 13) +Standards-Version: 3.7.2.2 + +Package: bplay +Architecture: any +Depends: ${shlibs:Depends} +Description: Buffered audio file player/recorder + The bplay package provides a simple command-line utility for playing + and recording audio files in raw sample, VOC and WAV formats. + . + To use this program you need a soundcard of some kind and the + appropriate driver configured into your kernel. + . + When run the program creates two processes which share a memory + buffer. It does reading/writing on the disk and the sound device + simultaneously, in order to be less liable to `pause' because the + disk is too slow or too busy. --- bplay-0.991.orig/debian/copyright +++ bplay-0.991/debian/copyright @@ -0,0 +1,22 @@ +This package was debianized by Ian Jackson + +It was originally downloaded from the metalab.unc.edu ftp site. + +Copyright: + +Copyright (c) 1994-2000 David Monro +Modifications for Debian GNU/Linux Copyright (C)1996 Ian Jackson. +Enhancements for Debian GNU/Linux by W.Akkerman + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +On Debian/GNU Linux system you can find a copy of this license in +`/usr/share/common-licenses/GPL --- bplay-0.991.orig/debian/dirs +++ bplay-0.991/debian/dirs @@ -0,0 +1 @@ +usr/bin --- bplay-0.991.orig/debian/mime +++ bplay-0.991/debian/mime @@ -0,0 +1,2 @@ +audio/x-wav; bplay %s; description="WAV audio format" ; priority=5 +audio/x-voc; bplay %s; description="VOC audio format" ; priority=5 --- bplay-0.991.orig/debian/rules +++ bplay-0.991/debian/rules @@ -0,0 +1,64 @@ +#!/usr/bin/make -f +# Based on the sample debian.rules by Ian Jackson +# Modified to be a prototype for debmake by Christoph Lameter + +CFLAGS = -Wall -g + +INSTALL = install +INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644 +INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755 +INSTALL_SCRIPT = $(INSTALL) -p -o root -g root -m 755 +INSTALL_DIR = $(INSTALL) -p -d -o root -g root -m 755 + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) +CFLAGS += -O0 +else +CFLAGS += -O2 +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) +INSTALL_PROGRAM += -s +endif + +CFLAGS += -DUSEBUFFLOCK + +package=bplay + +build: build-stamp +build-stamp: + dh_testdir + dh_clean + $(MAKE) CFLAGS="$(CFLAGS)" + touch build-stamp + +clean: + dh_testdir + -rm -f build-stamp + make clean + + dh_clean + +binary-arch: build + dh_testroot + dh_installdirs + + dh_install + dh_installdocs + dh_installman bplay.1 brec.1 + dh_installchangelogs + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +# Below here is fairly generic really + +binary: binary-arch +build-arch: build +build-indep: build + +.PHONY: build build-arch build-indep binary binary-arch binary-indep clean checkroot --- bplay-0.991.orig/fmtheaders.h +++ bplay-0.991/fmtheaders.h @@ -2,44 +2,51 @@ #define _FMTHEADERS_H 1 #include +#include + +#ifdef __GNUC__ +# define PACKED(x) __attribute__((packed)) x +#else +# define PACKED(x) x +#endif /* Definitions for .VOC files */ #define VOC_MAGIC "Creative Voice File\032" -#define DATALEN(bp) ((u_int)(bp.BlockLen[0]) | \ - ((u_int)(bp.BlockLen[1]) << 8) | \ - ((u_int)(bp.BlockLen[2]) << 16) ) +#define DATALEN(bp) ((u_int32_t)(bp.BlockLen[0]) | \ + ((u_int32_t)(bp.BlockLen[1]) << 8) | \ + ((u_int32_t)(bp.BlockLen[2]) << 16) ) typedef struct vochead { - u_char Magic[20]; /* must be VOC_MAGIC */ - u_short BlockOffset; /* Offset to first block from top of file */ - u_short Version; /* VOC-file version */ - u_short IDCode; /* complement of version + 0x1234 */ + u_int8_t Magic[20]; /* must be VOC_MAGIC */ + u_int16_t BlockOffset; /* Offset to first block from top of file */ + u_int16_t Version; /* VOC-file version */ + u_int16_t IDCode; /* complement of version + 0x1234 */ } vochead; typedef struct blockTC { - u_char BlockID; - u_char BlockLen[3]; /* low, mid, high byte of length of rest of block */ + u_int8_t BlockID; + u_int8_t BlockLen[3]; /* low, mid, high byte of length of rest of block */ } blockTC; typedef struct blockT1 { - u_char TimeConstant; - u_char PackMethod; + u_int8_t TimeConstant; + u_int8_t PackMethod; } blockT1; typedef struct blockT8 { - u_short TimeConstant; - u_char PackMethod; - u_char VoiceMode; + u_int16_t TimeConstant; + u_int8_t PackMethod; + u_int8_t VoiceMode; } blockT8; typedef struct blockT9 { u_int SamplesPerSec; - u_char BitsPerSample; - u_char Channels; - u_short Format; - u_char reserved[4]; + u_int8_t BitsPerSample; + u_int8_t Channels; + u_int16_t Format; + u_int8_t reserved[4]; } blockT9; @@ -51,21 +58,21 @@ it works on all WAVE-file I have */ typedef struct wavhead { - u_int main_chunk; /* 'RIFF' */ - u_int length; /* Length of rest of file */ - u_int chunk_type; /* 'WAVE' */ - - u_int sub_chunk; /* 'fmt ' */ - u_int sc_len; /* length of sub_chunk, =16 (rest of chunk) */ - u_short format; /* should be 1 for PCM-code */ - u_short modus; /* 1 Mono, 2 Stereo */ - u_int sample_fq; /* frequence of sample */ - u_int byte_p_sec; - u_short byte_p_spl; /* samplesize; 1 or 2 bytes */ - u_short bit_p_spl; /* 8, 12 or 16 bit */ + u_int32_t main_chunk; /* 'RIFF' */ + u_int32_t length; /* Length of rest of file */ + u_int32_t chunk_type; /* 'WAVE' */ + + u_int32_t sub_chunk; /* 'fmt ' */ + u_int32_t sc_len; /* length of sub_chunk, =16 (rest of chunk) */ + u_int16_t format; /* should be 1 for PCM-code */ + u_int16_t modus; /* 1 Mono, 2 Stereo */ + u_int32_t sample_fq; /* frequence of sample */ + u_int32_t byte_p_sec; + u_int16_t byte_p_spl; /* samplesize; 1 or 2 bytes */ + u_int16_t bit_p_spl; /* 8, 12 or 16 bit */ - u_int data_chunk; /* 'data' */ - u_int data_length; /* samplecount (lenth of rest of block?)*/ + u_int32_t data_chunk; /* 'data' */ + u_int32_t data_length; /* samplecount (lenth of rest of block?)*/ } wavhead; #endif --- bplay-0.991.orig/semantic.cache +++ bplay-0.991/semantic.cache @@ -0,0 +1,22 @@ +;; Object bplay-0.991/ +;; SEMANTICDB Tags save file +(semanticdb-project-database-file "bplay-0.991/" + :tables (list + (semanticdb-table "bplay.c" + :major-mode 'c-mode + :tags '(("_FILE_OFFSET_BITS" variable (:constant-flag t :default-value (nil)) nil [121 149]) ("_LARGEFILE_SOURCE" variable (:constant-flag t) nil [150 177]) ("_LARGEFILE64_SOURCE" variable (:constant-flag t) nil [176 206]) ("stdio.h" include (:system-flag t) nil [205 223]) ("unistd.h" include (:system-flag t) nil [224 243]) ("errno.h" include (:system-flag t) nil [244 262]) ("stdlib.h" include (:system-flag t) nil [263 282]) ("string.h" include (:system-flag t) nil [283 302]) ("stdint.h" include (:system-flag t) nil [303 322]) ("sys/types.h" include (:system-flag t) nil [323 345]) ("fcntl.h" include (:system-flag t) nil [346 364]) ("unistd.h" include (:system-flag t) nil [365 384]) ("signal.h" include (:system-flag t) nil [385 404]) ("sys/stat.h" include (:system-flag t) nil [405 426]) ("sys/wait.h" include (:system-flag t) nil [427 448]) ("sys/time.h" include (:system-flag t) nil [450 471]) ("sys/resource.h" include (:system-flag t) nil [472 497]) ("sys/soundcard.h" include (:system-flag t) nil [499 525]) ("_BSD_SOURCE" variable (:constant-flag t) nil [605 627]) ("endian.h" include (:system-flag t) nil [626 646]) ("endian.h" include (:system-flag t) nil [674 694]) ("sys/types.h" include (:system-flag t) nil [703 725]) ("byteswap.h" include (:system-flag t) nil [726 747]) ("cpu_to_le32" variable (:constant-flag t :default-value (nil)) nil [842 868]) ("cpu_to_le16" variable (:constant-flag t :default-value (nil)) nil [869 895]) ("cpu_to_le32" variable (:constant-flag t :default-value (nil)) nil [902 938]) ("cpu_to_le16" variable (:constant-flag t :default-value (nil)) nil [939 975]) ("le32_to_cpu" variable (:constant-flag t :default-value (nil)) nil [984 1023]) ("le16_to_cpu" variable (:constant-flag t :default-value (nil)) nil [1024 1063]) ("fmtheaders.h" include nil nil [1065 1088]) ("sndf_t" type (:typedef ("sndf_t" type (:members (("F_UNKNOWN" variable (:constant-flag t :type "int") (reparse-symbol enumsubparts) [1138 1148]) ("F_WAV" variable (:constant-flag t :type "int") (reparse-symbol enumsubparts) [1149 1155]) ("F_VOC" variable (:constant-flag t :type "int") (reparse-symbol enumsubparts) [1156 1162]) ("F_RAW" variable (:constant-flag t :type "int") (reparse-symbol enumsubparts) [1163 1169])) :type "enum") nil nil) :superclasses "sndf_t" :type "typedef") nil [1116 1176]) ("MSPEED" variable (:constant-flag t :default-value (nil)) nil [1178 1194]) ("MBITS" variable (:constant-flag t :default-value (nil)) nil [1195 1210]) ("MSTEREO" variable (:constant-flag t :default-value (nil)) nil [1211 1228]) ("progname" variable (:pointer 1 :type "char") nil [1244 1259]) ("forked" variable (:type "int") nil [1260 1271]) ("pid" variable (:type ("pid_t" type (:type "class") nil nil)) nil [1272 1282]) ("recorder" variable (:default-value "0" :type "int") nil [1283 1300]) ("debug" variable (:default-value "0" :type "int") nil [1301 1315]) ("verbose" variable (:default-value "1" :type "int") nil [1316 1332]) ("basename" function (:prototype-flag t :pointer 1 :typemodifiers ("extern") :type "char") nil [1417 1472]) ("Usage" function (:prototype-flag t :arguments (("" variable (:type "void") (reparse-symbol arg-sub-list) [1487 1492])) :type "void") nil [1476 1493]) ("ErrDie" function (:prototype-flag t :arguments (("err" variable (:pointer 1 :type "char") (reparse-symbol arg-sub-list) [1506 1516])) :type "void") nil [1494 1517]) ("Die" function (:prototype-flag t :arguments (("err" variable (:pointer 1 :type "char") (reparse-symbol arg-sub-list) [1527 1537])) :type "void") nil [1518 1538]) ("cleanup" function (:prototype-flag t :arguments (("val" variable (:type "int") (reparse-symbol arg-sub-list) [1553 1561]) ("arg" variable (:pointer 1 :type "void") (reparse-symbol arg-sub-list) [1562 1572])) :type "void") nil [1540 1573]) ("getbcount" function (:prototype-flag t :arguments (("speed" variable (:type "int") (reparse-symbol arg-sub-list) [1590 1600]) ("bits" variable (:type "int") (reparse-symbol arg-sub-list) [1601 1610]) ("stereo" variable (:type "int") (reparse-symbol arg-sub-list) [1611 1622]) ("" variable (:type "long long") (reparse-symbol arg-sub-list) [1623 1636]) ("bcount" variable (:pointer 1 :type "int") (reparse-symbol arg-sub-list) [1633 1645]) ("timelim" variable (:type "int") (reparse-symbol arg-sub-list) [1647 1659]) ("samplim" variable (:type "int") (reparse-symbol arg-sub-list) [1660 1672]) ("timejmp" variable (:type "int") (reparse-symbol arg-sub-list) [1673 1685]) ("sampjmp" variable (:type "int") (reparse-symbol arg-sub-list) [1686 1698]) ("bjump" variable (:pointer 1 :type "int") (reparse-symbol arg-sub-list) [1699 1710])) :type "void") nil [1575 1711]) ("playraw" function (:prototype-flag t :arguments (("thefd" variable (:type "int") (reparse-symbol arg-sub-list) [1725 1735]) ("hd_buf" variable (:dereference 1 :type "char") (reparse-symbol arg-sub-list) [1736 1752]) ("speed" variable (:type "int") (reparse-symbol arg-sub-list) [1753 1763]) ("bits" variable (:type "int") (reparse-symbol arg-sub-list) [1764 1773]) ("stereo" variable (:type "int") (reparse-symbol arg-sub-list) [1774 1785]) ("jump" variable (:type "int") (reparse-symbol arg-sub-list) [1787 1796]) ("secs" variable (:type "int") (reparse-symbol arg-sub-list) [1797 1806])) :type "void") nil [1712 1807]) ("playwav" function (:prototype-flag t :arguments (("thefd" variable (:type "int") (reparse-symbol arg-sub-list) [1821 1831]) ("hd_buf" variable (:dereference 1 :type "char") (reparse-symbol arg-sub-list) [1832 1848]) ("mods" variable (:type "int") (reparse-symbol arg-sub-list) [1849 1858]) ("speed" variable (:type "int") (reparse-symbol arg-sub-list) [1859 1869]) ("bits" variable (:type "int") (reparse-symbol arg-sub-list) [1870 1879]) ("stereo" variable (:type "int") (reparse-symbol arg-sub-list) [1881 1892]) ("jump" variable (:type "int") (reparse-symbol arg-sub-list) [1893 1902]) ("secs" variable (:type "int") (reparse-symbol arg-sub-list) [1903 1912])) :type "void") nil [1808 1913]) ("playvoc" function (:prototype-flag t :arguments (("thefd" variable (:type "int") (reparse-symbol arg-sub-list) [1927 1937]) ("hd_buf" variable (:dereference 1 :type "char") (reparse-symbol arg-sub-list) [1938 1954])) :type "void") nil [1914 1955]) ("audio" variable (:typemodifiers ("extern") :type "int") nil [1978 2016]) ("abuf_size" variable (:typemodifiers ("extern") :type "int") nil [1978 2016]) ("fmt_mask" variable (:typemodifiers ("extern") :type "int") nil [1978 2016]) ("audev" variable (:pointer 1 :typemodifiers ("extern") :type "char") nil [2017 2036]) ("bigbuffsize" variable (:typemodifiers ("extern") :type "int") nil [2037 2060]) ("init_sound" function (:prototype-flag t :typemodifiers ("extern") :arguments (("recorder" variable (:type "int") (reparse-symbol arg-sub-list) [2109 2122])) :type "void") nil [2086 2123]) ("snd_parm" function (:prototype-flag t :typemodifiers ("extern") :arguments (("speed" variable (:type "int") (reparse-symbol arg-sub-list) [2145 2155]) ("bits" variable (:type "int") (reparse-symbol arg-sub-list) [2156 2165]) ("stereo" variable (:type "int") (reparse-symbol arg-sub-list) [2166 2177])) :type "void") nil [2124 2178]) ("init_shm" function (:prototype-flag t :typemodifiers ("extern") :arguments (("" variable (:type "void") (reparse-symbol arg-sub-list) [2200 2205])) :type "void") nil [2179 2206]) ("shmrec" function (:prototype-flag t :typemodifiers ("extern") :arguments (("outfd" variable (:type "int") (reparse-symbol arg-sub-list) [2226 2236]) ("" variable (:type "long long") (reparse-symbol arg-sub-list) [2237 2250]) ("bcount" variable (:type "int") (reparse-symbol arg-sub-list) [2247 2258]) ("terminate" variable (:type "int") (reparse-symbol arg-sub-list) [2259 2273])) :type "void") nil [2207 2274]) ("diskread" function (:prototype-flag t :typemodifiers ("extern") :arguments (("outfd" variable (:type "int") (reparse-symbol arg-sub-list) [2296 2306]) ("" variable (:type "long long") (reparse-symbol arg-sub-list) [2307 2320]) ("bcount" variable (:type "int") (reparse-symbol arg-sub-list) [2317 2328]) ("hd_buf" variable (:dereference 1 :type "char") (reparse-symbol arg-sub-list) [2329 2345]) ("terminate" variable (:type "int") (reparse-symbol arg-sub-list) [2346 2360]) ("speed" variable (:type "int") (reparse-symbol arg-sub-list) [2365 2375]) ("bits" variable (:type "int") (reparse-symbol arg-sub-list) [2376 2385]) ("stereo" variable (:type "int") (reparse-symbol arg-sub-list) [2386 2397]) ("jump" variable (:type "int") (reparse-symbol arg-sub-list) [2398 2407])) :type "void") nil [2275 2408]) ("audiowrite" function (:prototype-flag t :typemodifiers ("extern" "volatile") :arguments (("" variable (:type "void") (reparse-symbol arg-sub-list) [2441 2446])) :type "void") nil [2409 2447]) ("initsems" function (:prototype-flag t :typemodifiers ("extern") :arguments (("disks" variable (:type "int") (reparse-symbol arg-sub-list) [2469 2479]) ("snds" variable (:type "int") (reparse-symbol arg-sub-list) [2480 2489])) :type "void") nil [2448 2490]) ("cleanupsems" function (:prototype-flag t :typemodifiers ("extern") :arguments (("" variable (:type "void") (reparse-symbol arg-sub-list) [2515 2520])) :type "void") nil [2491 2521]) ("main" function (:arguments (("argc" variable (:type "int") (reparse-symbol arg-sub-list) [2533 2542]) ("argv" variable (:pointer 1 :dereference 1 :type "char") (reparse-symbol arg-sub-list) [2543 2556])) :type "int") nil [2524 10372]) ("Usage" function (:arguments (("" variable (:type "void") (reparse-symbol arg-sub-list) [10385 10390])) :type "void") nil [10374 10550]) ("ErrDie" function (:arguments (("err" variable (:pointer 1 :type "char") (reparse-symbol arg-sub-list) [10564 10575])) :type "void") nil [10552 10656]) ("Die" function (:arguments (("err" variable (:pointer 1 :type "char") (reparse-symbol arg-sub-list) [10667 10678])) :type "void") nil [10658 10768]) ("cleanup" function (:arguments (("val" variable (:type "int") (reparse-symbol arg-sub-list) [10783 10791]) ("arg" variable (:pointer 1 :type "void") (reparse-symbol arg-sub-list) [10792 10802])) :type "void") nil [10770 10822]) ("getbcount" function (:arguments (("speed" variable (:type "int") (reparse-symbol arg-sub-list) [10839 10849]) ("bits" variable (:type "int") (reparse-symbol arg-sub-list) [10850 10859]) ("stereo" variable (:type "int") (reparse-symbol arg-sub-list) [10860 10871]) ("" variable (:type "long long") (reparse-symbol arg-sub-list) [10872 10885]) ("bcount" variable (:pointer 1 :type "int") (reparse-symbol arg-sub-list) [10882 10894]) ("timelim" variable (:type "int") (reparse-symbol arg-sub-list) [10896 10908]) ("samplim" variable (:type "int") (reparse-symbol arg-sub-list) [10909 10921]) ("timejmp" variable (:type "int") (reparse-symbol arg-sub-list) [10922 10934]) ("sampjmp" variable (:type "int") (reparse-symbol arg-sub-list) [10935 10947]) ("bjump" variable (:pointer 1 :type "int") (reparse-symbol arg-sub-list) [10948 10959])) :type "void") nil [10824 11311]) ("playraw" function (:arguments (("thefd" variable (:type "int") (reparse-symbol arg-sub-list) [11326 11336]) ("hd_buf" variable (:dereference 1 :type "char") (reparse-symbol arg-sub-list) [11337 11353]) ("speed" variable (:type "int") (reparse-symbol arg-sub-list) [11354 11364]) ("bits" variable (:type "int") (reparse-symbol arg-sub-list) [11365 11374]) ("stereo" variable (:type "int") (reparse-symbol arg-sub-list) [11375 11386]) ("jump" variable (:type "int") (reparse-symbol arg-sub-list) [11387 11396]) ("secs" variable (:type "int") (reparse-symbol arg-sub-list) [11397 11406])) :type "void") nil [11313 11659]) ("playwav" function (:arguments (("thefd" variable (:type "int") (reparse-symbol arg-sub-list) [11674 11684]) ("hd_buf" variable (:dereference 1 :type "char") (reparse-symbol arg-sub-list) [11685 11701]) ("mods" variable (:type "int") (reparse-symbol arg-sub-list) [11702 11711]) ("speed" variable (:type "int") (reparse-symbol arg-sub-list) [11712 11722]) ("bits" variable (:type "int") (reparse-symbol arg-sub-list) [11723 11732]) ("stereo" variable (:type "int") (reparse-symbol arg-sub-list) [11733 11744]) ("jump" variable (:type "int") (reparse-symbol arg-sub-list) [11745 11754]) ("secs" variable (:type "int") (reparse-symbol arg-sub-list) [11755 11764])) :type "void") nil [11661 12885]) ("playvoc" function (:arguments (("thefd" variable (:type "int") (reparse-symbol arg-sub-list) [12900 12910]) ("hd_buf" variable (:dereference 1 :type "char") (reparse-symbol arg-sub-list) [12911 12927])) :type "void") nil [12887 16770])) + :file "bplay.c" + :pointmax 16771 + :unmatched-syntax 'nil + ) + (semanticdb-table "shmbuf.c" + :major-mode 'c-mode + :tags '(("stdio.h" include (:system-flag t) nil [184 202]) ("stdlib.h" include (:system-flag t) nil [203 222]) ("unistd.h" include (:system-flag t) nil [223 242]) ("string.h" include (:system-flag t) nil [243 262]) ("errno.h" include (:system-flag t) nil [263 281]) ("signal.h" include (:system-flag t) nil [282 301]) ("sys/types.h" include (:system-flag t) nil [302 324]) ("sys/ipc.h" include (:system-flag t) nil [325 345]) ("sys/sem.h" include (:system-flag t) nil [346 366]) ("sys/shm.h" include (:system-flag t) nil [367 387]) ("sys/wait.h" include (:system-flag t) nil [388 409]) ("SEMMSL" variable (:constant-flag t :default-value (nil)) nil [460 477]) ("DEFAULTBUFFSIZE" variable (:constant-flag t :default-value (nil)) nil [585 617]) ("blockinf_t" type (:typedef ("blockinf_t" type (:members (("count" variable (:type "int") (reparse-symbol classsubparts) [663 673]) ("last" variable (:type "int") (reparse-symbol classsubparts) [714 723]) ("setit" variable (:type "int") (reparse-symbol classsubparts) [773 783]) ("speed" variable (:type "int") (reparse-symbol classsubparts) [853 863]) ("bits" variable (:type "int") (reparse-symbol classsubparts) [868 877]) ("stereo" variable (:type "int") (reparse-symbol classsubparts) [882 893])) :type "struct") nil nil) :superclasses "blockinf_t" :type "typedef") nil [631 907]) ("semun" type (:members (("val" variable (:type "int") (reparse-symbol classsubparts) [992 1000]) ("buf" variable (:pointer 1 :type ("semid_ds" type (:type "struct") nil nil)) (reparse-symbol classsubparts) [1027 1048]) ("array" variable (:pointer 1 :type "unsigned short int") (reparse-symbol classsubparts) [1087 1113]) ("__buf" variable (:pointer 1 :type ("seminfo" type (:type "struct") nil nil)) (reparse-symbol classsubparts) [1147 1169])) :type "union") nil [977 1199]) ("bigbuffsize" variable (:default-value "DEFAULTBUFFSIZE;" :type "int") nil [1223 1257]) ("shmid" variable (:typemodifiers ("static") :type "int") nil [1300 1356]) ("shmid2" variable (:typemodifiers ("static") :type "int") nil [1300 1356]) ("disksemid" variable (:pointer 1 :typemodifiers ("static") :default-value "0" :type "int") nil [1300 1356]) ("sndsemid" variable (:pointer 1 :typemodifiers ("static") :default-value "0" :type "int") nil [1300 1356]) ("bigbuff" variable (:pointer 1 :typemodifiers ("static") :type "char") nil [1357 1378]) ("buffarr" variable (:pointer 2 :typemodifiers ("static") :type "char") nil [1379 1401]) ("numbuffs" variable (:typemodifiers ("static") :type "int") nil [1402 1434]) ("numsemblks" variable (:typemodifiers ("static") :type "int") nil [1402 1434]) ("buffinf" variable (:pointer 1 :typemodifiers ("static") :type ("blockinf_t" type (:type "class") nil nil)) nil [1435 1462]) ("cleanupsems" function (:prototype-flag t :arguments (("" variable (:type "void") (reparse-symbol arg-sub-list) [1498 1503])) :type "void") nil [1481 1504]) ("sighandler" function (:prototype-flag t :typemodifiers ("static") :arguments (("i" variable (:type "int") (reparse-symbol arg-sub-list) [1528 1534])) :type "void") nil [1505 1535]) ("abuf_size" variable (:typemodifiers ("extern") :type "int") nil [1558 1579]) ("audio" variable (:typemodifiers ("extern") :type "int") nil [1580 1597]) ("progname" variable (:pointer 1 :typemodifiers ("extern") :type "char") nil [1598 1620]) ("pid" variable (:typemodifiers ("extern") :type ("pid_t" type (:type "class") nil nil)) nil [1621 1638]) ("recorder" variable (:typemodifiers ("extern") :type "int") nil [1639 1659]) ("debug" variable (:typemodifiers ("extern") :type "int") nil [1660 1677]) ("ErrDie" function (:prototype-flag t :typemodifiers ("extern") :arguments (("err" variable (:pointer 1 :type "char") (reparse-symbol arg-sub-list) [1722 1732])) :type "void") nil [1703 1733]) ("snd_parm" function (:prototype-flag t :typemodifiers ("extern") :arguments (("speed" variable (:type "int") (reparse-symbol arg-sub-list) [1755 1765]) ("bits" variable (:type "int") (reparse-symbol arg-sub-list) [1766 1775]) ("stereo" variable (:type "int") (reparse-symbol arg-sub-list) [1776 1787])) :type "void") nil [1734 1788]) ("sync_audio" function (:prototype-flag t :typemodifiers ("extern") :arguments (("" variable (:type "void") (reparse-symbol arg-sub-list) [1812 1817])) :type "void") nil [1789 1818]) ("cleanup_audio" function (:prototype-flag t :typemodifiers ("extern") :arguments (("" variable (:type "void") (reparse-symbol arg-sub-list) [1845 1850])) :type "void") nil [1819 1851]) ("init_shm" function (:arguments (("" variable (:type "void") (reparse-symbol arg-sub-list) [1867 1872])) :type "void") nil [1853 4841]) ("up" function (:arguments (("semblk" variable (:pointer 1 :type "int") (reparse-symbol arg-sub-list) [4898 4910]) ("xsemnum" variable (:type "int") (reparse-symbol arg-sub-list) [4911 4923])) :type "void") nil [4890 5151]) ("down" function (:arguments (("semblk" variable (:pointer 1 :type "int") (reparse-symbol arg-sub-list) [5210 5222]) ("xsemnum" variable (:type "int") (reparse-symbol arg-sub-list) [5223 5235])) :type "void") nil [5200 5464]) ("shmrec" function (:arguments (("outfd" variable (:type "int") (reparse-symbol arg-sub-list) [5507 5517]) ("" variable (:type "long long") (reparse-symbol arg-sub-list) [5518 5531]) ("totalcount" variable (:type "int") (reparse-symbol arg-sub-list) [5528 5543]) ("terminate" variable (:type "int") (reparse-symbol arg-sub-list) [5544 5558])) :type "void") nil [5495 7486]) ("diskread" function (:arguments (("infd" variable (:type "int") (reparse-symbol arg-sub-list) [7502 7511]) ("" variable (:type "long long") (reparse-symbol arg-sub-list) [7512 7525]) ("totalplay" variable (:type "int") (reparse-symbol arg-sub-list) [7522 7536]) ("hd_buf" variable (:dereference 1 :type "char") (reparse-symbol arg-sub-list) [7537 7553]) ("terminate" variable (:type "int") (reparse-symbol arg-sub-list) [7558 7572]) ("speed" variable (:type "int") (reparse-symbol arg-sub-list) [7573 7583]) ("bits" variable (:type "int") (reparse-symbol arg-sub-list) [7584 7593]) ("stereo" variable (:type "int") (reparse-symbol arg-sub-list) [7594 7605]) ("jump" variable (:type "int") (reparse-symbol arg-sub-list) [7606 7615])) :type "void") nil [7488 9963]) ("audiowrite" function (:typemodifiers ("volatile") :arguments (("" variable (:type "void") (reparse-symbol arg-sub-list) [9990 9995])) :type "void") nil [9965 11065]) ("initsems" function (:arguments (("disks" variable (:type "int") (reparse-symbol arg-sub-list) [11081 11091]) ("snds" variable (:type "int") (reparse-symbol arg-sub-list) [11092 11101])) :type "void") nil [11067 11391]) ("cleanupsems" function (:arguments (("" variable (:type "void") (reparse-symbol arg-sub-list) [11411 11416])) :type "void") nil [11394 11708]) ("sighandler" function (:typemodifiers ("static") :arguments (("i" variable (:type "int") (reparse-symbol arg-sub-list) [11733 11739])) :type "void") nil [11710 11925])) + :file "shmbuf.c" + :pointmax 11926 + ) + ) + :file "semantic.cache" + :semantic-tag-version "2.0beta3" + :semanticdb-version "2.0beta3" + ) --- bplay-0.991.orig/shmbuf.c +++ bplay-0.991/shmbuf.c @@ -57,7 +57,7 @@ int bigbuffsize = DEFAULTBUFFSIZE; /* Statics - mostly shared memory etc */ -static int shmid, shmid2, *disksemid, *sndsemid; +static int shmid, shmid2, *disksemid = 0, *sndsemid = 0; static char *bigbuff; static char **buffarr; static int numbuffs, numsemblks; @@ -165,8 +165,12 @@ /* Malloc arrays of semaphore ids (ints) for the semaphores */ if ((disksemid = (int*)malloc(sizeof(int)*numsemblks)) == NULL) ErrDie("malloc"); + for (i=0;i abuf_size) @@ -297,18 +307,27 @@ } } -void diskread(int infd, int totalplay, char hd_buf[20], int terminate, - int speed, int bits, int stereo) +void diskread(int infd, long long int totalplay, char hd_buf[20], + int terminate, int speed, int bits, int stereo, int jump) { int count, i, limited = 0; char *tmppt; - int numread, totalread = 0; + int numread; + long long int totalread = 0; int first = 1; static int triggered = 0; /* Have we let the writer go? */ static int cbuff = 0; /* Which buffer */ + if (jump) + { + jump = jump * speed * (bits/8) * (stereo * 2); + + if (lseek (infd, jump, SEEK_CUR) < jump) + fprintf(stderr, "couldn't jump %d bytes\n", jump); + } + if (totalplay) limited = 1; if (totalplay == -1) { @@ -476,11 +495,14 @@ s.val = 0; - for (i = 0; i < numsemblks; i++) - { - semctl(disksemid[i], 0, IPC_RMID, s); - semctl(sndsemid[i], 0, IPC_RMID, s); - } + if (disksemid) + for (i = 0; i < numsemblks; i++) + if (disksemid[i] != -1) + semctl(disksemid[i], 0, IPC_RMID, s); + if (sndsemid) + for (i = 0; i < numsemblks; i++) + if (sndsemid[i] != -1) + semctl(sndsemid[i], 0, IPC_RMID, s); } static void sighandler(int i) --- bplay-0.991.orig/sndfunc.c +++ bplay-0.991/sndfunc.c @@ -69,6 +69,9 @@ sync_audio(); /* Set the sample speed, size and stereoness */ + /* We only use values of 8 and 16 for bits. This implies + * unsigned data for 8 bits, and little-endian signed for 16 bits. + */ if (ioctl(audio, SNDCTL_DSP_SAMPLESIZE, &bits) < 0) ErrDie(audev); if (ioctl(audio, SNDCTL_DSP_STEREO, &stereo) < 0)