summaryrefslogtreecommitdiff
path: root/usr.bin/cdplay/cdplay.c
AgeCommit message (Collapse)Author
2021-11-27usr.bin: remove unnecessary CONSTCOND, lint no longer needs itrillig
Since 2021-01-31, lint no longer requires a CONSTCOND comment in a do-while-0 statement since this is a common code pattern, especially in statement-like macros.
2020-10-18cdplay: remove redundant parentheses around return valuerillig
Purely cosmetic change. The generated code stays exactly the same.
2015-06-17more stray \nchristos
2013-10-07fix the rest of the lint warnings [pass 1]christos
2013-10-07Merge some of the cleanup from PR 21894. Do a bit more of my own.dholland
lint still squawks quite a bit, and it woudl probably be worthwhile for someone to go through and make all the signedness consistent, but I think I've got the valuable bits.
2012-01-04-make digital mode work in non-interactive mode (init sighandlerdrochner
earlier, sleep(3) until playing finished) -also switch to digital mode if an audio device is given on the cmd line, or the (new) "CDPLAY_DIGITAL" env var is set (The latter can be used to make digital mode default per system. As I see it, analog mode is not dead yet - two of three external DVD drives I looked at have a speaker output.)
2012-01-04kill unnecessary srandom() call which crept in in rev. 1.33drochner
2011-11-26If the ioctl to play tracks returned EINVAL, switch to digital mode andchristos
try again. XXX: Should we do this for the other ioctls? Should we default to digital mode? Definitely the error message is completely unfriendly and should be fixed.
2011-08-29ANSIfy + static + __deadjoerg
2009-04-11fix -W sign-compare issues.lukem
2009-02-22fix a dud indentdholland
2008-12-29handle 64 bit time_tchristos
2008-07-16some improvements to digital play mode:drochner
-use AUMODE_PLAY_ALL, from Sergey Svishchev -- this might cause stuttering if the write to audio can't keep up, but it avoids pauses if the audio buffer drains out on stop/resume -The timeout for the raw SCSI command to read audio data was too small, causing complete failure for me. -Since the itimer can't do faster than HZ, a too small buffer doesn't work. Try to calculate a sensible buffer size. -While it makes sense to deliver data a bit faster than necessary, it should be not that much that the blocking in the signal handler hurts interactive response. Allow for 50ms. -Comment out a sched_yield() in the signal handler - this doesn't look right. This is far from being perfect, but it makes digital mode usable for me. And for Jeremy C. Reed, the author of PR bin/38493.
2007-01-24if ioctl(fd, CDIOCPLAYMSF,...) fails, do not warn("ioctl(CDIOREADTOCENTRYS)");abs
2006-12-27arg might be improperly initialized; fix that.dogcow
(also, since we check arg == NULL, s/arg = 0/arg = NULL/.)
2006-12-27CID-4199: move the test (line != NULL) one line up to check thealc
return value of strdup() ok christos@
2006-12-14take into account the 150 frame start offset time when computing thechuck
duration of a track. call lba2msf like this: lba2msf(len - 150, &m, &s, &f); ^^^^^ from rev 1.41 of FreeBSD usr.sbin/cdcontrol/cdcontrol.c, Dmitry Afanasiev. XXX: note that this is a mis-use of lba2msf() because 'len' is the length of the track in frames, not a logical block address (lba).
2006-10-22remove bogus assertion.christos
2006-09-22Apply patch from PR bin/34545 sent by Sergey Svishchev to add supportxtraeme
for digital transfer mode, not enabled by default. To use it: $ cdplay -a /dev/audio (otherwise /dev/sound will be used) and type "digital" on the interactive mode. Thank you very much Sergey, it's very useful. Reviewed and ok by christos@.
2006-01-12Applied patch from PR bin/14505 Tested on i386-current. Fixes inability ofgarbled
cdplay to properly play a cd immediately following an eject command in interactive mode. Patch supplied by Sergey Svishchev.
2006-01-02Add repeat mode to cdplay(1) per PR bin/13970garbled
Applied the second patch in the PR, with minor tweaking, and adjusted manpage for change.
2005-06-02appease gcc -Wuninitializedlukem
2004-10-30Add (unsigned char) cast to ctype functionsdsl
2004-09-10use arc4randomitojun
2003-09-12eliminate unneeded use of sigcontext.christos
2003-07-14use bounded string opitojun
2003-07-14use bounded string op as much as possibleitojun
2003-02-28Remove unused printf argument.matt
2003-02-19Show the last "track" as the start of the lead-out area instead of asimonb
bogus track number. Remove a magic number and (slightly) simplify the TOC entry display function a little.
2003-01-30Fix PR 18444 and a few other corner cases in cdplay.c.is
2002-09-280 is a valid value for the absolute minute to stop playing. Initializeis
to UINT_MAX before scanning, and check for UINT_MAX to detect whether it was set. Without this, it is not possible to play the first less than a minute of a CD using absolute msf addresses.
2002-06-11err/errx/warn/warnx do not need \n at the enditojun
2002-01-23Need <sys/types.h> early on.thorpej
2001-08-20Fix typo.ad
2001-08-20warn() -> warnx() in one place.ad
2001-08-20- Implement shuffle play and some other goodies. Mostly from a patchad
submitted by Sergey Svishchev <svs@ropnet.ru> in PR 13682. - More tidying.
2001-08-20Cleanup.ad
2001-08-20Use getrawpartition().ad
2001-07-01Add support for skipping to the previous and next tracks.gmcgarry
2001-02-19convert to use getprogname()cgd
2000-12-16replace guts of opencd() with call to opendisk(). prevents coredumplukem
when a device with a leading / (e.g, `/dev/cd0') is given, as well as promotes code reuse ;-)
2000-10-11More format string cleanup by sommerfeld.is
2000-08-30Allow a single argument to 'volume' to set both channels.abs
2000-06-15use play_track() instead of play_blocks() when play whole diskmsaitoh
(because the xfer length field of the PLAY command (0x45) is 2 bytes. It's too short to play whole disk)
2000-06-14Apply patch supplied in PR 8561 from URA Hiroshi: fixes LBA mode display onad
little endian machines.
2000-06-13Use my proper name.ad
2000-01-05- ntohl() -> be32toh().ad
- Dispence with some of the idiocy in run(). - Couple of nits.
1999-11-26cdplay now uses libedit!msaitoh
1999-09-18Some cleanup [Fixes to follow as soon as I get a CD-ROM drive at home]ad
1999-06-05KNFad