aboutsummaryrefslogtreecommitdiffhomepage
path: root/audio
Commit message (Collapse)AuthorAge
* ao_alsa: reinitialize if device got brokenGravatar wm42015-01-21
| | | | | | | | | Apparently, physically disconnecting the audio device (consider USB audio) breaks the ALSA device handle forever. It will signal ENODEV. Fortunately, it's easy for us to handle this, and we can just use existing mechanisms that will make the playback core close and reopen the AO. Whether the immediate reopening will actually succeeds really is ALSA's problem, though.
* ao_coreaudio: reset possibly random errno valueGravatar wm42015-01-20
| | | | | | | | | | In general, you need to check errno when using strtol(), but as far as I know, strtol() won't reset errno on success. This has to be done manually. The code could have failed sporadically if strtol() succeeded, and errno was already set to one of the checked values. (This strtol() still isn't fully error checked, but I don't know if it's intentional, e.g. for parsing a numeric prefix only.)
* ao: never autoselect ao_nullGravatar wm42015-01-20
| | | | | | | | | Before this commit, ao_null was used as last fallback. This doesn't make too much sense. Why would you decode audio just to discard it? Let audio initialization fail instead. This also handles the weird but possible corner-case that ao_null might fail initializing, in which case e.g. ao_pcm could be autoselected. (This happened once, and had to be fixed manually.)
* ao: refactor --audio-device selection codeGravatar wm42015-01-20
| | | | | | | | | | | | | | This removes the slightly duplicated code for picking the required AO driver if --audio-device forces one. Now --audio-device reuses the same code as --ao for this. As a consequence, ao_alloc_pb() and ao_create() can be merged into ao_init(). Although the ao_init() argument list, which is already pretty big, grows by one, it's better than having all these similar sounding functions around. Actually, I just wanted to do the change the following commit will do, but I found this code was more of a mess than it had to be.
* af: remove old filter compatibility hackGravatar wm42015-01-15
|
* audio/filter: switch remaining filters to refcountingGravatar wm42015-01-15
| | | | | All of these filters are very similar in frame management, and copy data to a new frame during filtering.
* audio/filter: switch remaining in-place filters to refcountingGravatar wm42015-01-15
| | | | | | | | | | | | | | | | | | Adds about 7 lines of boilerplate per filter. This could be avoided by providing a different entrypoint (something like af->filter_inplace), which would basically mirror the old interface exactly for this kind of filter. But I feel like it would just be a hack to support all those old, useless filters better. (The ideal solution would be using a language that can do closures to provide a compat. wrapper, but whatever.) af_bs2b has terribly repetitious code for setting up filter functions for each format (most of them useless, in addition to bs2b being useless), so I did something terrible with macros. af_sinesuppress had commented code for float filtering (maybe it was broken; it has been commented every since it was added in 2006). Remove this code.
* af: verify filter input formatsGravatar wm42015-01-15
| | | | | | | | | | | Just to make sure all filters get the correct format. Together wih the check in af_add_output_frame(), this asserts that af->prev->fmt_out == af->fmt_in This also requires setting the "in" pseudo-filter (s->first) formats correctly. Before this commit, the fmt_in/fmt_out fields weren't used for this filter.
* ao_alsa: fix a small memory leakGravatar wm42015-01-14
|
* af_lavcac3enc: use refcounted framesGravatar wm42015-01-14
|
* af_lavfi: use refcounted framesGravatar wm42015-01-14
|
* audio/filter: actually set fmt_in/fmt_out fieldsGravatar wm42015-01-14
|
* af_scaletempo: use refcounted framesGravatar wm42015-01-14
|
* af_lavrresample: use refcounted framesGravatar wm42015-01-14
|
* audio: add missing declarationGravatar wm42015-01-14
|
* ao_pcm: add append modeGravatar wm42015-01-14
| | | | | Pretty useful for debugging, although a bit useless or possibly misleading too (see comments in the manpage).
* audio: fix initial audio PTSGravatar wm42015-01-14
| | | | | | | | | | Commit 5e25a3d2 broke handling of the initial frame (the one decoded with initial_audio_decode()). It didn't update the pts_offset field, leading to a shift in timestamps by one audio frame. Fix by calling the actual decode function in a single place. This requires slightly more changes than what would be necessary to fix the bug, but it also somewhat simplifies the data flow.
* audio: fix assertion failure on audio decodingGravatar wm42015-01-14
| | | | | | | There are several cases in which a decoder may need several packets to produce some output audio. Commit 5e25a3d2 broke this. Fixes #1471.
* af_convert24: use refcounted framesGravatar wm42015-01-13
| | | | | This requires allocating a fully new frame. 32->24 could be in-place, but this is not possible for 24->32.
* audio/filters: use refcounted frames for some in-place filtersGravatar wm42015-01-13
| | | | | These are also quite simple, but require requesting write access to the frames. The error handling (for OOM) is a bit annoying.
* audio/filters: use refcounted frames for some simple filtersGravatar wm42015-01-13
| | | | These are read-only, and very trivial to convert.
* af_volume: use refcounted framesGravatar wm42015-01-13
|
* audio: use refcounted frames in the filter chainGravatar wm42015-01-13
| | | | | | | | | | | | | | | | | | | The goal is switching the whole audio chain to using refcounted frames. This brings the architecture closer to FFmpeg, enables better integration with libavfilter, will reduce useless copying somewhat, and will probably allow better timestamp tracking. For now, every filter goes through a semi-awful wrapper in af_do_filter(), though. This will be fixed step by step, and the wrapper should eventually be removed. Another thing that will have to be done is improving the timestamp handling and avoiding extra copies for the AO. Some of the new code is rather similar to the video filter code (the core filter code basically just has types replaced). Such code duplication is normally very unwanted, but in this case there's probably no other choice. On the other hand, this code is pretty simple (even if somewhat tricky). Maybe there will be unified filter code in the future, but this is still far away.
* audio: add some utility functions for refcounted framesGravatar wm42015-01-13
| | | | Used in the following commits.
* audio/filter: remove unused af_calc_filter_multiplier()Gravatar wm42015-01-13
| | | | | | | | | | | | The purpose of this function was to filter only as much audio input as needed to produce a certain amount of audio output. This could (in theory) avoid excessive buffering when e.g. changing playback speed with resampling. Use of this was already removed in commit 5fd8a1e0. No problems were experienced, so let's assume this feature is practically worthless. (Though it's possible that it was quite useful over a decade ago, or in some cornercases with evil files.)
* ao_pulse: exit AO if stream failsGravatar wm42015-01-11
| | | | | | This can for example reproduced by killing the pulseaudio server. If this happens, just try to reload the AO, instead of breaking everything forever.
* ao_alsa: fix dtshd passthroughGravatar wm42015-01-09
| | | | | | | We must not try to remap channels with this. Whethever ALSA gives us, and whatever we do with it, the result will probably be nonsense. Untested, as I don't have the required hardware.
* ao: remove coreaudio_exclusive from autoprobing listGravatar wm42015-01-07
| | | | Apparently this was a mistake.
* ao_pulse: disable latency calculation hacks by defaultGravatar wm42015-01-07
| | | | | | | | | | | | | | This used to be required to workaround PulseAudio bugs. Even later, when the bugs were (partially?) fixed in PulseAudio, I had the feeling the hacks gave better behavior. On the other hand, I couldn't actually reproduce any bad behavior without the hacks lately. On top of this, it seems our hacks sometimes perform much worse than PulseAudio's native implementation (see #1430). So disable the hacks by default, but still leave the code and the option in case it still helps somewhere. Also, being able to blame PulseAudio's code by using its native API is much easier than trying to debug our own (mplayer2-derived) hacks.
* win32: request UTF-16 API variants, Vista+ APIs, and COM C macrosGravatar wm42015-01-07
| | | | | Put the Vista+ (_WIN32_WINNT) and the COM C (COBJMACROS) defines into the build system, instead of defining them over and over in the code.
* player: print used number of threads in verbose modeGravatar wm42015-01-05
| | | | Also, don't use av_log() for mpv output.
* af_volume: dump applied replaygain in verbose modeGravatar wm42015-01-04
|
* ao/wasapi: style/code formatting tweaksGravatar Kevin Mitchell2015-01-02
|
* ao/wasapi: improve exclusive mode format searchGravatar Kevin Mitchell2015-01-02
| | | | fixes #1376
* ao/wasapi: revamp set_waveformatexGravatar Kevin Mitchell2015-01-02
| | | | | | | | * bits instead of bytes * add valid_bits argument * just pass in the mp_chmap and get the number and wavext channel map from that * indicate valid bits in waveformat_to_str * make appropriate accomodations in try_format
* ao/wasapi: add CO_E_NOTINITIALIZED to explain_errGravatar Kevin Mitchell2015-01-02
| | | | someone on irc reported seeing this error
* ao_portaudio: remove this audio outputGravatar wm42014-12-29
| | | | | It's just completely useless. We have good native support for all 3 desktop platforms, and ao_sdl or ao_openal as fallbacks.
* ao_alsa: print channel map if setting it failsGravatar wm42014-12-29
| | | | | | | | | | This message is printed when the audio device advertised a channel map, but couldn't set it - which is probably a dmix bug (we'll never know, ALSA doesn't take bug reports). Print the requested map, so that the user (maybe) can make a connection when seeing the message and the actually used channel map, which might be less confusing. Or at least less useless.
* ao: add debug log with the detected channel mapsGravatar Stefano Pigozzi2014-12-29
| | | | This could be helpful with bug reports.
* chmap_sel: add multichannel fallback heuristicGravatar Stefano Pigozzi2014-12-29
| | | | | | | | | | | | Instead of just failing during channel map selection, try to select a close layout that makes most sense and upmix/downmix to that instead of failing AO initialization. The heuristic is rather simple, and uses the following steps: 1) If mono is required always prefer stereo to a multichannel upmix. 2) Search for an upmix that is an exact superset of the required channel map. 3) Search for a downmix that is the exact subset of the required channel map. 4) Search for either an upmix or downmix that is the closest (minimum difference of channels) to the required channel map.
* chmap: add a 7.1(rear) layout nameGravatar Stefano Pigozzi2014-12-29
| | | | This is common on Apple systems so it's handy to have a label for it.
* ao_coreaudio: remove useless guardGravatar Stefano Pigozzi2014-12-27
| | | | useless after 069016fd6c
* ao_coreaudio: fix some naming conventionsGravatar Stefano Pigozzi2014-12-27
|
* ao_coreaudio: fix channel mappingGravatar Stefano Pigozzi2014-12-27
| | | | | | | | | | | | | | | There where 3 major errors in the previous code: 1) The kAudioDevicePropertyPreferredChannelLayout selector returns a single layout not an array. 2) The check for AudioChannelLayout allocation size was wrong (didn't account for variable sized struct). 3) Didn't query the kAudioDevicePropertyPreferredChannelsForStereo selector since I didn't know about it's existence. All of these are fixed. Might help with #1367
* ao_coreaudio: fix typoGravatar Stefano Pigozzi2014-12-27
|
* ao_coreaudio: move some code to make output readableGravatar Stefano Pigozzi2014-12-27
|
* ao_coreaudio: add more layout debug outputsGravatar Stefano Pigozzi2014-12-27
| | | Should help remote debugging #1367 with --msg-level=ao=debug
* win32: add mmap() emulationGravatar wm42014-12-26
| | | | | | | | Makes all of overlay_add work on windows/mingw. Since we now don't explicitly check for mmap() anymore (it's always present), this also requires us to make af_export.c compile, but I haven't tested it.
* ao_coreaudio: fix AudioChannelLayout allocationsGravatar Stefano Pigozzi2014-12-26
| | | | | | | | AudioChannelLayout uses a trailing variable sized array so we need to query CoreAudio for the size of the struct it is going to need (or the conversion of that particular layout would fail). Fixes #1366
* ao_alsa: fix unpause path atfer previous commitGravatar wm42014-12-23
| | | | The resume code was accidentally fully removed from this code path.