aboutsummaryrefslogtreecommitdiff
path: root/src/volume.c
Commit message (Collapse)AuthorAge
* commandError() cleanups, fixup gcc checksEric Wong2006-07-30
| | | | | | | stripped binary size reduced by 9k on my machine from making commandError a function. We'll print out error messages slightly slower before, but the smaller binary is more than worth it. git-svn-id: https://svn.musicpd.org/mpd/trunk@4488 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* interface/connection malloc reductions from mpd-keEric Wong2006-07-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch massively reduces the amount of heap allocations at the interface/command layer. Most commands with minimal output should not allocate memory from the heap at all. Things like repeatedly polling status, currentsong, and volume changes should be faster as a result, and more importantly, not a source of memory fragmentation. These changes should be safe in that there's no way for a remote-client to corrupt memory or otherwise do bad stuff to MPD, but an extra set of eyes to review would be good. Of course there's never any warranty :) No longer do we use FILE * structures in the interface, which means we don't have to allocate any new memory for most connections. Now, before you go on about losing the buffering that FILE * +implies+, remember that myfprintf() never took advantage of any of the stdio buffering features. To reduce the diff and make bugs easier to spot in the diff, I've kept myfprintf in places where we write to files (and not network interfaces). Expect myfprintf to go away entirely soon (we'll use fprintf for writing regular files). git-svn-id: https://svn.musicpd.org/mpd/trunk@4483 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Add mpd-indent.shAvuton Olrich2006-07-20
| | | | | | Indent the entire tree, hopefully we can keep it indented. git-svn-id: https://svn.musicpd.org/mpd/trunk@4410 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* alsa: fix memory leaks from snd_*_open*()Eric Wong2006-07-17
| | | | | | | | | ALSA uses a global config structure that's overwritten (and not free'd) every time one of those functions is called, so we have to manually call snd_config_update_free_global() to release it. Hint taken from MEMORY-LEAK in the ALSA source code git-svn-id: https://svn.musicpd.org/mpd/trunk@4381 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* sparse: ANSI-fy function declarationsEric Wong2006-07-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are just warnings from sparse, but it makes the output easier to read. I ran this through a quick perl script, but of course verified the output by looking at the diff and making sure the thing still compiles. here's the quick perl script I wrote to generate this patch: ----------- 8< ----------- use Tie::File; defined(my $pid = open my $fh, '-|') or die $!; if (!$pid) { open STDERR, '>&STDOUT' or die $!; exec 'sparse', @ARGV or die $!; } my $na = 'warning: non-ANSI function declaration of function'; while (<$fh>) { print STDERR $_; if (/^(.+?\.[ch]):(\d+):(\d+): $na '(\w+)'/o) { my ($f, $l, $pos, $func) = ($1, $2, $3, $4); $l--; tie my @x, 'Tie::File', $f or die "$!: $f"; print '-', $x[$l], "\n"; $x[$l] =~ s/\b($func\s*)\(\s*\)/$1(void)/; print '+', $x[$l], "\n"; untie @x; } } git-svn-id: https://svn.musicpd.org/mpd/trunk@4378 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* OSS: handle device disconnects and reconnects (w/o needing a mpd restart)Eric Wong2006-07-16
| | | | | | | Like the ALSA patches, this allows OSS devices to be disconnected during playback and MPD will be able to reopen and reuse them without restarting. git-svn-id: https://svn.musicpd.org/mpd/trunk@4366 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* volume: gracefully handle disconnected ALSA mixersEric Wong2006-07-16
| | | | | | | This should help with the previous set of patches against the ALSA audio output. We should have fully disconnectable/reconnectable ALSA devices now. git-svn-id: https://svn.musicpd.org/mpd/trunk@4365 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* [CLEANUP] Cleanup whitespace->tabsAvuton Olrich2006-07-15
| | | | | | Remove dead code Static where possible git-svn-id: https://svn.musicpd.org/mpd/trunk@4345 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Change shank's email addressJ. Alexander Treuman2006-07-14
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4333 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Huge header update, update the copyright and addAvuton Olrich2006-07-13
| | | | | the GPL header where necessary git-svn-id: https://svn.musicpd.org/mpd/trunk@4317 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* undo change 3081Warren Dukes2005-03-15
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@3085 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* - Add 'mute' command for testingAvuton Olrich2005-03-14
| | | | | - Revamp AUTHORS file git-svn-id: https://svn.musicpd.org/mpd/trunk@3081 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* make PCM the default controller for the mixerWarren Dukes2005-03-08
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@3035 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* if a home directory is available for 'user', set env variable $HOMEWarren Dukes2004-10-31
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2426 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* finish integrating in np's oss stuffWarren Dukes2004-10-30
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2413 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* merge shank-rewrite-config changesWarren Dukes2004-10-28
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2375 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix C99 stuff for commandErrorWarren Dukes2004-06-15
| | | | | also some slight optimizations to interfacePrintWithFD() and myfprintf() git-svn-id: https://svn.musicpd.org/mpd/trunk@1503 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Add WARNING log method. it's the same as ERROR, except that when mpd starts,Warren Dukes2004-06-12
| | | | | | warnings are buffered until the error log is opened, and then flushed to the error log. git-svn-id: https://svn.musicpd.org/mpd/trunk@1442 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* finish ack error codesWarren Dukes2004-06-04
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1325 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* clean up ACK error coding a little bitWarren Dukes2004-06-04
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1321 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* add vim shiznit to end of all source filesWarren Dukes2004-04-14
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@750 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* more software volume tweeksWarren Dukes2004-04-11
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@684 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* adjust scaling of software volumeWarren Dukes2004-04-11
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@681 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* use EXIT_SUCCESS and EXIT_FAILUREWarren Dukes2004-04-02
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@591 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* for alsa mixer default to Master element, not the first elementWarren Dukes2004-04-01
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@583 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* strcasecmp for mixer_controlWarren Dukes2004-03-24
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@436 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* alsa volume fixesWarren Dukes2004-03-23
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@421 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* volume fixesWarren Dukes2004-03-23
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@420 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix a bug where getting OS Mixer volume may fail, and we were closingWarren Dukes2004-02-29
| | | | | | | the fd, but didn't mark anything indicated the fd was close, so chaos ensued. Here, we just remove the close() statement and assume it was just a fluke!! git-svn-id: https://svn.musicpd.org/mpd/trunk@125 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* import from SF CVSWarren Dukes2004-02-23
git-svn-id: https://svn.musicpd.org/mpd/trunk@1 09075e82-0dd4-0310-85a5-a0d7c8717e4f