summaryrefslogtreecommitdiffstats
path: root/audio
Commit message (Collapse)AuthorAgeFilesLines
* 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/+28
|
* af_lavfi: switch to new option APIwm42013-07-221-8/+24
| | | | | This makes it actually possible to use the filter with more complicated filter graphs (such as graphs containing the "," character).
* af_scaletempo: use new option APIwm42013-07-221-84/+44
|
* af_lavrresample: switch to new option APIwm42013-07-221-51/+45
| | | | | Also add a "o" suboption, which should allow fine control over libavresample.
* af_force: use new option APIwm42013-07-221-34/+21
|
* audio/filter: use new option APIwm42013-07-225-163/+99
| | | | | | | | | | | | | Make the VF/VO/AO option parser available to audio filters. No audio filter uses this yet, but it's still a quite intrusive change. In particular, the commands for manipulating filters at runtime completely change. We delete the old code, and use the same infrastructure as for video filters. (This forces complete reinitialization of the filter chain, which hopefully isn't a problem for any use cases. The old code forced reinitialization too, but it could potentially allow a filter to cache things; e.g. consider loaded ladspa plugins and such.)
* af_force: add option that causes filter to fail at initializationwm42013-07-221-1/+9
| | | | This is useful for debugging.
* af: fix recovery code for filter insertion (changing volume with spdif crash)wm42013-07-221-4/+2
| | | | | | | | | | | | This code is supposed to run if dynamic filter insertion (such as when inserting a volume filter in mixer.c) fails. Then it removes all filters and recreates the default list of filters. But the code just blew up and entered an endless loop, because it removed even the sentinel in/out filters. This could happen when trying to use softvol controls while using spdif, but also other situations. Fix it by calling the correct code. Also remove these obnoxious yoda-conditions.
* audio/decode: remove macro crapwm42013-07-227-115/+61
| | | | | Declare decoders directly, instead of using the LIBAD_EXTERN macro. This is simpler (no weird magic) and more extensible.
* ao_wasapi: Make default on Windows.Diogo Franco (Kovensky)2013-07-221-3/+3
| | | | Ahead of OSS because cygwin provides OSS.
* ao_wasapi: Fix S/PDIF passthrough initDiogo Franco (Kovensky)2013-07-221-3/+4
| | | | | | | | | | MSDN tells me to multiply the samplerates by 4 (for setting up the S/PDIF signal frequency), but doesn't mention that I'm only supposed to do it on the new, NT6.1+ IEC 61937 structs. Works on my Realtek Digital Output, but as I can't connect any hardware to it I can't hear the result. Also, always ask for little-endian AC3. I'm not sure if this is supposed to be LE or NE, but Windows is LE on all platforms, so we go with LE.
* ao_wasapi: Log the passthrough format in MSGL_VDiogo Franco (Kovensky)2013-07-221-0/+5
|
* ao_wasapi: Also do passthrough for AF_FORMAT_MPEG2Diogo Franco (Kovensky)2013-07-221-1/+1
| | | | That's the sample format ad_spdif uses when the source is MP3.
* ao_wasapi: Support S/PDIF passthroughDiogo Franco (Kovensky)2013-07-221-0/+45
| | | | | | | Entirely untested as this troper has no S/PDIF hardware. Refuses trying any other format if we can't use passthrough, or we would end up sending white noise at the user.
* ao_wasapi: Fix double free on uninitDiogo Franco (Kovensky)2013-07-221-2/+0
| | | | | Caused by incorrect conversion to the m_option API: since we don't allocate the state ourselves, we also don't free it ourselves.
* ao_wasapi: Support loading devices by nameDiogo Franco (Kovensky)2013-07-221-17/+65
| | | | | | | | | Do an strstr match against the device description and, if we have only