summaryrefslogtreecommitdiffstats
path: root/mixer.c
Commit message (Collapse)AuthorAgeFilesLines
* mixer: silence message about inserting volume filterwm42012-07-301-2/+3
| | | | But only if softvol is enabled. Otherwise, it should be a warning.
* mixer: support native audio driver muteUoti Urpala2012-04-111-7/+24
| | | | | | | | | | | | | Make mixer support setting the mute attribute at audio driver level, if one exists separately from volume. As of this commit, no libao2 driver exposes such an attribute yet; that will be added in later commits. Since the mute status can now be set externally, it's no longer completely obvious when the player should automatically disable mute when uninitializing an audio output. The implemented behavior is to turn mute off at uninitialization if we turned it on and haven't noticed it turn off (by external means) since.
* audio: fix unmute-at-end logicUoti Urpala2012-04-111-3/+25
| | | | | | | | | | | | The player tried to disable mute before exiting, so that if mute is emulated by setting volume to 0 and the volume setting is a system-global one, we don't leave it at 0. However, the logic doing this at process exit was flawed, as volume settings are handled by audio output instances and the audio output that set the mute state may have been closed earlier. Trying to write reliably working logic that restores volume at exit only would be tricky, so change the code to always unmute an audio driver before closing it and restore mute status if one is opened again later.
* audio: restore balance setting after reinitUoti Urpala2012-04-111-5/+23
| | | | | | | Restore the audio balance setting when the audio chain is reinitialized (also after switching to another file). Also add a note about the balance code being seriously buggy.
* audio: restore volume setting after AO reinit if neededUoti Urpala2012-04-111-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | MPlayer volume control was originally implemented with the assumption that it controls a system-wide volume setting which keeps its value even if a process closes and reopens the audio device. However, this is not actually true for --softvol mode or some audio output APIs that only consider volume as a per-client setting for software mixing. This could have annoying results, as the volume would be reset to a default value if the AO was closed and reopened, for example whem moving to a new file or crossing ordered chapter boundaries. Add code to set the previous volume again after audio reinitialization if the current audio chain is known to behave this way (softvol active or the AO driver is known to not keep persistent volume externally). This also avoids an inconsistency with the mute flag. The frontend assumed the mute status is persistent across file changes, but it could be similarly lost. The audio drivers that are assumed to not keep persistent volume are: coreaudio, dsound, esd, nas, openal, sdl. None of these changes have been tested. I'm guessing that ESD and NAS do per-connection non-persistent volume settings. Partially based on code by wm4.
* audio: mixer: change logic for AOs with no volume controlUoti Urpala2012-04-111-24/+27
| | | | | | | | | | The volume filter was automatically inserted if setting AO volume failed. Remove that logic, and instead enable softvol mode fully if querying current volume (which will happen before any set attempts) fails. Fully switching to softvol mode is more robust, and any case where the behavior would differ (the behavior is neither that both querying/setting always work nor that both always fail) would have been buggy.
* audio: keep volume level internally (not only in AO)Uoti Urpala2012-04-111-44/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current volume was always queried from the the audio output driver (or filter in case of --softvol). The only case where it was stored on mixer level was that when turning off mute, volume was set to the value it had before mute was activated. Change the mixer code to always store the current target volume internally. It still checks for significant changes from external sources and resets the internal value in that case. The main functionality changes are: Volume will now be kept separately from mute status. Increasing or decreasing volume will now change it relative to the original value before mute, even if mute is implemented by setting AO level volume to 0. Volume changes no longer automatically disable mute. The exception is relative changes up (like the volume increase key in default keybindings); that's the only case which still disables mute. Keeping the value internally avoids problems with granularity of possible volume values supported by AO. Increase/decrease keys could work unsymmetrically, or when specifying a smaller than default --volstep, even fail completely. In one case occurring in practice, if the AO only supports changing volume in steps of about 2 and rounds down the requested volume, then volume down key would decrease by 4 but volume up would increase by 2 (previous volume plus or minus the default change of 3, rounded down to a multiple of 2). Now, the internal value will keep full precision.
* options: move mixer.h options to structUoti Urpala2012-03-201-14/+9
|
* mixer: reindent/cosmetic changeswm42012-03-201-102/+102
| | | | | | There should be no real semantic changes. Remove the mixer_setbothvolume macro, as it was unused.
* audio: change external AO interface to "ao_[method](ao, ...)"Uoti Urpala2011-04-091-4/+4
| | | | | | | | Make the outside interface of audio output handling similar to the video output one. An AO object is first created, and then methods called with ao_[methodname](ao, args...). However internally libao2/ still holds all data in globals, and trying to create multiple simultaneous AO instances won't work.
* Delete things related to old translation systemUoti Urpala2010-03-101-1/+0
| | | | | Remove the help/ subdirectory, configure code to create toplevel help_mp.h, and all the '#include "help_mp.h"' lines from .c files.
* Merge svn changes up to r30475Uoti Urpala2010-03-091-0/+18
|\
| * Add license header to all top-level files missing them.diego2010-01-301-0/+18
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30471 b3059339-0415-0410-9bf9-f77b7e298cf2
| * whitespace cosmetics: Remove all trailing whitespace.diego2009-05-131-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Remove trailing whitespace from most filesUoti Urpala2009-07-071-2/+1
| |
* | Translation system changes part 2: replace macros by stringsAmar Takhar2009-07-071-3/+3
| | | | | | | | | | Replace all MSGTR_ macros in the source by the corresponding English string.
* | Translation system changes part 1: wrap translated stringsAmar Takhar2009-07-071-3/+3
|/ | | | | Replace mp_msg() calls which have a translated string as the format argument with mp_tmsg and add _() around all other translated strings.
* The audio balance feature implemented with af_pan.zuxy2007-06-201-0/+43
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23588 b3059339-0415-0410-9bf9-f77b7e298cf2
* allow forcing of software volume control and setting maximum amplification.reimar2004-11-141-9/+11
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13934 b3059339-0415-0410-9bf9-f77b7e298cf2
* automatic loading of af_volume, original patch by Dan Christiansen (danchr ↵reimar2004-07-281-3/+10
| | | | | | (at) daimi (dot) au (dot) dk) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12909 b3059339-0415-0410-9bf9-f77b7e298cf2
* 1000lalex2004-06-261-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12689 b3059339-0415-0410-9bf9-f77b7e298cf2
* New 'Mixer API' with ability to change volume through libaf (this part was ↵alex2004-06-261-39/+61
| | | | | | written by Reimar Doffinger) and lesser global variables git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12673 b3059339-0415-0410-9bf9-f77b7e298cf2
* add option to select mixer channelattila2004-01-241-0/+1
| | | | | | | patch by Catalin Muresan <catalin.muresan@astral.ro> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11838 b3059339-0415-0410-9bf9-f77b7e298cf2
* MINGW32 portfaust32003-03-311-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9773 b3059339-0415-0410-9bf9-f77b7e298cf2
* 64bit libao2 fix by Jens Axboe <mplayer-dev@kernel.dk>alex2003-03-211-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9634 b3059339-0415-0410-9bf9-f77b7e298cf2
* add mute support ( step 1 ) and fixed panscan bugs (1000l for me)pontscho2002-06-061-1/+15
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6312 b3059339-0415-0410-9bf9-f77b7e298cf2
* Moved HW dependent mixer stuff to libao and removed master switchanders2002-02-211-138/+20
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4789 b3059339-0415-0410-9bf9-f77b7e298cf2
* DVB mixer control added (very big messy hack)arpi2002-02-171-0/+31
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4750 b3059339-0415-0410-9bf9-f77b7e298cf2
* Applied fix for mixercontrol w/alsa ossemu by Christian Ohm.atmos42001-09-111-4/+5
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1882 b3059339-0415-0410-9bf9-f77b7e298cf2
* patch by Jürgen Keilarpi_esp2001-06-081-8/+32
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1062 b3059339-0415-0410-9bf9-f77b7e298cf2
* applied solaris8/netbsd/other fixes patch by Jürgen Keil <jk@tools.de>arpi_esp2001-06-051-32/+64
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1039 b3059339-0415-0410-9bf9-f77b7e298cf2
* Solaris 8 support - patch by Marcus Comstedt <marcus@idonex.se>arpi_esp2001-06-051-0/+21
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1021 b3059339-0415-0410-9bf9-f77b7e298cf2
* warnings killedszabii2001-04-231-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@606 b3059339-0415-0410-9bf9-f77b7e298cf2
* using /dev/mixer as defaultarpi_esp2001-04-211-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@557 b3059339-0415-0410-9bf9-f77b7e298cf2
* some code cleanuppontscho2001-04-181-11/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@513 b3059339-0415-0410-9bf9-f77b7e298cf2
* init releasepontscho2001-04-161-2/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@462 b3059339-0415-0410-9bf9-f77b7e298cf2
* ups, I missed'em..gabucino2001-04-151-0/+91
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@442 b3059339-0415-0410-9bf9-f77b7e298cf2