summaryrefslogtreecommitdiffstats
path: root/audio
Commit message (Collapse)AuthorAgeFilesLines
* ao_jack: don’t force exact client nameMartin Herkt2013-09-301-1/+1
| | | | | | | | Trying to connect multiple mpv clients to JACK with the JackUseExactName option would fail unless the user manually specifies a unique client name. This changes the behavior to automatically generate a unique name if the requested one is already in use.
* ao_oss: add support for SNDCTL_DSP_RESET and use it when pausingPaul B Mahol2013-09-231-0/+6
| | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: wm4 <wm4@nowhere>
* ao_pulse: bug fix: goto the correct error handlerJohan Kiviniemi2013-09-201-2/+2
|
* ao_pulse: set the property media.role=videoJohan Kiviniemi2013-09-201-2/+17
|
* af: merge af_reinit() and fix_output_format()wm42013-09-202-30/+12
| | | | | | | | | | | | | | | | Calling them separately doesn't really make sense, and all existing calls to them usually combined them. One subtitle difference was that af_init() didn't wipe the filter chain if initialization of the chain itself failed, but that didn't really make sense anyway. Also remove af_init() from the code for setting balance in mixer.c. The mixer should be in the initialized state only if audio is fully initialized, so the af_init() call made no sense. Note that the filter "editing" code in command.c doesn't really do a nice job of handling errors in case recreating an _old_ (known to work) filter chain unexpectedly fails, and this obscure/rare case might be differently handled after this change.
* mixer: make struct opaquewm42013-09-204-42/+50
| | | | Also remove stray include statements from ao_alsa and ao_oss.
* mixer: restore volume with playback resumewm42013-09-202-1/+30
| | | | | | | | | Note that this is intentionally never done if the AO or softvolume is different, or if the current volume control method is thought to control system wide volume (such as ALSA) or otherwise user controllable (such as PulseAudio). The intention is to keep things robust and to avoid messing with the user's audio settings as far as possible, while still providing the ability to resume volume if it makes sense.
* mixer: don't unmute audio when raising volumewm42013-09-191-2/+0
| | | | This is rather strange behavior, away with it.
* mixer: refactor, fix some aspects of --volume handlingwm42013-09-192-68/+124
| | | | | | | | | | | | | | | | | | | | Refactor how mixer.c does volume/mute restoration and initialization. Move to handling of --volume and --mute to mixer.c. Simplify the implementation of these and hopefully fix bugs/strange behavior related to using them as file-local options (this uses a somewhat dirty trick: the option values are reverted to "auto" after initialization). Put most code related to initialization and volume restoring in probe_softvol() and restore_volume(). Having this code all in one place is less confusing. Instead of trying to detect whether to use softvol at runtime, detect it at initialization time using AOCONTROL_GET_VOLUME (same with mute, AOCONTROL_GET_MUTE). This implies we expect SET_VOLUME/SET_MUTE to work if the GET variants work. Hopefully this is always the case. This is also preparation for being able to change volume/mute settings if audio is disabled, and for allowing restoring value with playback resume.
* mixer, af_volume: use linear values instead of dBwm42013-09-192-21/+21
| | | | | | | Softvol always used a linear multiplier for volume control. This was converted to dB, and then back to linear in af_volume. Remove this non- sense. We still try to keep the command line argument to af_volume in dB, though.
* mixer: minor refactoringwm42013-09-192-26/+27
| | | | | Let struct mixer access access MPOpts to simplify some things. Rename some variables and functions. There should be no functional changes.
* af_export: fix compilation warningwm42013-09-191-2/+1
| | | | Blargh.
* Config path functions can return NULLwm42013-09-181-0/+6
| | | | | | | It's quite unlikely, but functions like mp_find_user_config_file() can return NULL, e.g. if $HOME is unset. Fix all the code that didn't check for this correctly yet.
* audio: fix playback of Musepack SV8 fileswm42013-09-011-2/+4
| | | | | | | | | | | | | | This is basically a libavcodec API oddity: it can happen that avcodec_decode_audio4() returns 0 (meaning 0 bytes were consumed). It requires you to feed the complete packet again to decode the full packet, and to successfully decode the following packets. We ignored this case with the argument that there's the danger of an endless decode loop (because nothing of that packet is apparently decoded, so it would retry forever), but change it in order to decode mpc8 files correctly. Also add some comments to explain the mess.
* audio: don't allow setting unknown formats from command linewm42013-08-261-17/+1
| | | | | | | af_str2fmt_short(), which is used by the command line option parser, allowed passing a hex number. The user could set arbitrary integers as internal audio formats, even formats which don't exist or make no sense. This is not very useful, so get rid of it.
* audio: make internal audio format 0 an invalid formatwm42013-08-263-9/+9
| | | | | | | | | | | | Having to use -1 for that is generally quite annoying. Audio formats are created from bitmasks, and it can't be excluded that 0 is not a valid format. Fix this by adjusting AF_FORMAT_I so that it is never 0. Along with AF_FORMAT_F and the special formats, all valid formats are covered and guaranteed to be non-0. It's possible that this commit will cause some regressions, as the check for invalid audio formats changes a bit.
* Some more mp_msg conversionswm42013-08-232-101/+61
| | | | | Also add a note to mp_msg.h, since it might be not clear which of the two mechanisms is preferred.
* audio/out: do some mp_msg conversionswm42013-08-228-163/+118
| | | | | | | Use the new MP_ macros for some AOs instead of mp_msg. Not all AOs are converted, and some only partially. In some cases, some additional cosmetic changes are made.
* ao: remove some leftoverswm42013-08-222-7/+0
|
* core: move contents to mpvcore (2/2)Stefano Pigozzi2013-08-0635-73/+73
| | | | Followup commit. Fixes all the files references.
* Merge pull request #154 from rossy2401/wasapi-pauseDiogo Franco2013-08-051-1/+2
|\ | | | | WASAPI stops working after pause
| * ao_wasapi: don't check the audio feed while pausedJames Ross-Gowan2013-07-271-1/+2
| |
* | core: change speed option/property to doublewm42013-08-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The --speed option and the speed property used float. Change them to double. Change the commands that manipulate the property (speed_mult/add) to double as well. Since the cycle command shares code with the add command, we change that as well. The reason for this change is that this allows better control over speed, such as stepping by semitones. Using floats is also just plain unnecessary.
* | ao_coreaudio: move to new log APIStefano Pigozzi2013-08-014-99/+101
| |
* | ao_coreaudio: remove useless definesStefano Pigozzi2013-08-011-3/+0
| | | | | | | | They are already defined in the header file
* | audio/out: add support for new logging APIStefano Pigozzi2013-08-012-8/+15
| |
* | Fix some warningsJonathan Yong2013-07-301-6/+6
| |
* | ao_coreaudio: use default output unit when no device is specifiedStefano Pigozzi2013-07-291-1/+3
| | | | | | | | | | | | Using the default output audio unit should provide a much better user exeperience since it changes automatically the output device based on which becomes the default one.
* | ao_coreaudio: prevent buffer underruns to output garbageStefano Pigozzi2013-07-281-1/+6
| | | | | | | | | | | | This was removed in d427b4fd. I now found a sample that causes underruns when moving to a chapter and apparently this is also a problem when taking screenshots.
* | ao_coreaudio: fix compilation on OS X 10.7Dmitry Kalinkin2013-07-281-1/+1
|/ | | | | | | | | | | | Reverts one of the changes from 18777ecf. `kAudioObjectPropertyScopeOutput` was introduced in the 10.8 SDK while `kAudioDevicePropertyScopeOutput` was moved to `AudioHardwareDeprecated.h`. Since the deprecation is silent for now (no warnings), just use the old constant. Either way, they both evaluate to 'outp', and in the 10.8 SDK the deprecated constant is defined in terms of the non-deprecated one. Fixes #155
* Fix some -Wshadow warningswm42013-07-232-5/+5
| | | | | | In general, this warning can hint to actual bugs. We don't enable it yet, because it would conflict with some unmerged code, and we should check with clang too (this commit was done by testing with gcc).
* options: make legacy hacks for AFs/VFs more explicitwm42013-07-221-0/+1
| | | | | This means that AOs/VOs with no options set do not take the legacy option parsing path, but instead report that they have no options.
* audio/out: remove options argument from init()wm42013-07-2216-31/+18
| | | | Same as with VOs in the previous commit.
* Remove subopt-helperwm42013-07-221-1/+1
| | | | Finally not used by anything anymore. Farewell.
* ao_coreaudio: fix ifdef'd conditionalStefano Pigozzi2013-07-221-1/+1
| | | | | The big endian case was not covered. Doesn't make much difference since mpv runs on Macs with x86 only, but for the sake of correctness.
* ao_coreaudio: use new option APIStefano Pigozzi2013-07-221-38/+22
|
* ao_coreaudio: switch properties getters to tallocStefano Pigozzi2013-07-223-18/+19
|
* ao_coreaudio: reduce verbosity of the chmapping codeStefano Pigozzi2013-07-221-2/+2
|
* ao_coreaudio: revert to original device format on digital uninitStefano Pigozzi2013-07-221-3/+11
| | | | | | This is not done automatically by CoreAudio. I am told that it would a PITA to have to switch back the format manually on the device (especially if the same device is used for lpcm output).
* ao_coreaudio: refactor chmap detectionStefano Pigozzi2013-07-223-91/+96
| | | | | | b2f9e0610 introduced this functionality with code that was quite 'monolithic'. Split the functionality over several functions and ose the new macros to get array properties.
* ao_coreaudio: refactor properties codeStefano Pigozzi2013-07-224-146/+111
| | | | | | | | Introduce some macros to deal with properties. These allow to work around the limitation of CoreAudio's API being `void **` based. The macros allow to keep their client's code DRY, by not asking size and other details which can be derived by the macro itself. I have no idea why Apple didn't design their API like this in the first place.
* ao_coreaudio: move utils functions to snake_caseStefano Pigozzi2013-07-223-39/+34
|
* ao_coreaudio: split ao_coreaudio_common in two filesStefano Pigozzi2013-07-225-160/+287
| | | | | | | | | * ao_coreaudio_utils: contains several utility function * ao_coreaudio_properties: contains functions to set and get audio object properties. Conflicts: audio/out/ao_coreaudio.c
* ao_coreaudio: store asbd only when selectedStefano Pigozzi2013-07-221-4/+1
| | | | | Previous code needlessly stored the input asbd before actually testing it's support against the hardware.
* ao_coreaudio: fallback to waveext on non surround inputsStefano Pigozzi2013-07-221-3/+3
|
* ao_coreaudio: set channel layout based on hardware queryStefano Pigozzi2013-07-221-2/+106
| | | | this is a wip
* ao_coreaudio: fix regression in digital stream selectionStefano Pigozzi2013-07-221-1/+1
| | | | | | The condition was checked wrongly on asbd which is the input format description. This lead to the condition always being true, thus selecting lpcm streams for digital input.
* ao_coreaudio: return errors instead false in init functionsStefano Pigozzi2013-07-221-3/+3
|
* ao_coreaudio: remove useless function declarationStefano Pigozzi2013-07-221-3/+0
|
* ao_coreaudio: only set chmap_sel info for lpcmStefano Pigozzi2013-07-221-5/+7
|
* ao_coreaudio: set channel layout bitmapStefano Pigozzi2013-07-221-1/+17
|
* ao_coreaudio: move digital detection before asbd creationStefano Pigozzi2013-07-221-10/+9
|
* ao_coreaudio: remove chmap selection if format is digitalStefano Pigozzi2013-07-221-1/+0
|
* ao_coreaudio: remove volume multiplication by 4Stefano Pigozzi2013-07-221-2/+2
| | | | | kHALOutputParam_Volume is the linear gain so it should be at maximum 1 to keep the audio quality good. No idea why it was more than that.
* ao_coreaudio: remove device property listener on uninitStefano Pigozzi2013-07-222-12/+32
| | | | Also extract this functionality inside a function in coreaudio_common
* ao_coreaudio: print help string in one goStefano Pigozzi2013-07-221-5/+11
|
* ao_coreaudio: change all ++var to var++Stefano Pigozzi2013-07-222-12/+8
| | | | | Luckily they all were inside for loops so the functionality does not actually change.
* ao_coreaudio: change private vars names to match mpv conventionsStefano Pigozzi2013-07-221-91/+101
|
* ao_coreaudio: remove packetSize private variableStefano Pigozzi2013-07-221-3/+3
|
* ao_coreaudio: refactor play/pauseStefano Pigozzi2013-07-221-27/+15
|
* ao_coreaudio: refactor uninitStefano Pigozzi2013-07-221-17/+6
|
* ao_coreaudio: remove a fixme since that seems fixedStefano Pigozzi2013-07-221-2/+0
|
* ao_coreaudio: ca_msg: add trailing \n where missingStefano Pigozzi2013-07-222-6/+6
|
* ao_coreaudio: refactor playStefano Pigozzi2013-07-221-16/+8
|
* ao_coreaudio: extract mixmode set/unset in utility functionsStefano Pigozzi2013-07-222-46/+58
|
* ao_coreaudio: move AudioStreamChangeFormat to common file and refactorStefano Pigozzi2013-07-222-86/+74
|
* ao_coreaudio: extract methods to lock/unlock device for digital outputStefano Pigozzi2013-07-222-28/+26
|
* ao_coreaudio: lpcm: remove buffer size calculation depending on audio unitStefano Pigozzi2013-07-221-8/+0
|
* ao_coreaudio: refactor initializationStefano Pigozzi2013-07-222-396/+282
| | | | | | | | | | | | | The initialization is split more clearly between compressed and lpcm case. For the compressed case, format selection is simplified a lot and negotiation removed. The way it was written it just passed back to the core the original requested format, not what was found available on hardware. Since this is most likely useless for the compressed case, I didn't bother with this. In the future I'd like to split this AO in two one that only uses the AUHAL and the other with direct access to the hardware so that even passthrough of lcpm can be possible. This would decrease the latency, audiophiles would like that.
* ao_coreaudio: refactor print_helpStefano Pigozzi2013-07-221-26/+21
|
* ao_coreaudio: split out some utility functions and refactor themStefano Pigozzi2013-07-222-310/+315
| | | | | | | Split out some utility functions that use the CoreAudio API but are not related the main task of the AOs (which is to move data correctly to the ringbuffer). These are mainly need for the verbosity of the CoreAudio API and are just obscuring the 'real' code.
* ao_coreaudio: make variable names shorterStefano Pigozzi2013-07-221-30/+30
| | | | property_address -> p_addr
* ao_coreaudio: add error check function and macroStefano Pigozzi2013-07-221-41/+68
| | | | WIP
* ao_coreaudio: dry up ca_msg and use it everywhereStefano Pigozzi2013-07-221-61/+57
| | | | | Change the ca_msg macro to pass along MSGT_AO automatically. Also use it for every output for consistency.
* ao_coreaudio: simplify digital render callbackStefano Pigozzi2013-07-221-4/+3
| | | | | It was reported that it also works by not setting the read size in the AudioBuffer (now idea how, but I will discover it later).
* ao_coreaudio: rewrite spdif render callbackStefano Pigozzi2013-07-221-39/+20
|
* ao_coreaudio: simplify render callbackStefano Pigozzi2013-07-221-23/+9
| | | | | | | Read only the requested amount by the AUHAL (instead of all the buffered data). No idea what the deal is with pausing the audio units if there is no audio to play, maybe to avoid underruns of some sort. Anyway from my tests this condition never occurred so I'm removing it all.
* af_bs2b: use new option APIwm42013-07-221-84/