summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_sndio.c
Commit message (Collapse)AuthorAgeFilesLines
* audio: remove S8, U16, U24, U32 formatswm42015-06-161-12/+8
| | | | | | | | | | | | | They are useless. Not only are they actually rarely in use; but libavcodec doesn't even output them, as libavcodec has no such sample formats for decoded audio. Even if it should happen that we actually still need them (e.g. if doing direct hardware output), there are better solutions. Swapping the sign is a fast and lossless operation and can be done inplace, so AO actually needing it could do this directly. If you wonder why we keep U8 instead of S8: because libavcodec does it.
* audio: define only a single NA speaker IDwm42015-05-071-1/+1
| | | | | Remove the requirement from mp_chmap that speaker entries must be unique. Use this to get rid of all the redundant NA speaker IDs.
* ao_sndio: add notice about padding channelswm42015-05-061-1/+3
| | | | (I won't do this, but someone else seeing this might.)
* ao_sndio: open device in blocking mode, don't inflate buffer artificiallyDmitrij D. Czarkoff2015-03-261-20/+2
| | | | | | The code actually uses blocking mode, so opening sound device in non-blocking mode results in choppy sound. Also, inflating the buffer isn't necessary in blocking mode, so the function may simply return without doing anything.
* audio/out: consistently use double return type for get_delaywm42014-11-091-1/+1
| | | | | ao_get_delay() returns double, but the get_delay callback still returned float.
* Add some missing "const"swm42014-10-101-2/+4
| | | | | | | The one in msg.c was mistakenly removed with commit e99a37f6. I didn't actually test the change in ao_sndio.c (but obviously "ap" shouldn't be static).
* ao_sndio: print a warning when draining audiowm42014-09-261-7/+14
| | | | | | | | | | | libsndio has absolutely no mechanism to discard already written audio (other than SIGKILLing the sound server). sio_stop() will always block until all audio is played. This is a legitimate design bug. In theory, we could just not stop it at all, so if the player is e.g. paused, the remaining audio would be played. When resuming, we would have to do something to ensure get_delay() returns the right value. But I couldn't get it to work in all cases.
* ao_sndio: update buffer status on get_delaywm42014-09-261-9/+15
| | | | | | get_delay needs to report the current audio buffer status. It's important for A/V sync that this information is current, but functions which update it were called on play() or get_space() calls only.
* ao_sndio: change p->delay to sampleswm42014-09-261-7/+5
| | | | | | | This was in bytes, but it's more convenient to use samples (or frames; in any case the smallest unit of audio that includes all channels). Remove the ao->bps line too; it will be set after init() returns.
* ao_sndio: set non-blocking flagwm42014-09-261-1/+1
| | | | | | Otherwise the feed thread and the playloop will get randomly blocked. This seems to fix most A/V sync issues.
* ao_sndio: fix some incorrect commentswm42014-09-261-2/+2
| | | | The AO API always uses sample counts.
* ao_sndio: fix U24 bit widthwm42014-09-241-1/+1
| | | | This was wrong since the initial commit.
* audio: drop swapped-endian audio formatswm42014-09-231-25/+17
| | | | | | | | | | | | | | | | | | | | Until now, the audio chain could handle both little endian and big endian formats. This actually doesn't make much sense, since the audio API and the HW will most likely prefer native formats. Or at the very least, it should be trivial for audio drivers to do the byte swapping themselves. From now on, the audio chain contains native-endian formats only. All AOs and some filters are adjusted. af_convertsignendian.c is now wrongly named, but the filter name is adjusted. In some cases, the audio infrastructure was reused on the demuxer side, but that is relatively easy to rectify. This is a quite intrusive and radical change. It's possible that it will break some things (especially if they're obscure or not Linux), so watch out for regressions. It's probably still better to do it the bulldozer way, since slow transition and researching foreign platforms would take a lot of time and effort.
* audio/out: always round get_space on period sizewm42014-09-061-1/+2
| | | | | | | | | | | Round get_space() results in the same way play() rounds the input size. Some audio APIs do this for various reasons. This affects only "push" based AOs. Some of these need no change, because they either do it already right (like ao_openal), or they seem not to have any such requirements (like ao_pulse). Needed for the following commit.
* ao_sndio: fix a commentwm42014-09-061-2/+2
| | | | | Whether this code was written with the correct assumptions in mind, I don't know.
* audio/out: remove old thingswm42014-09-061-1/+2
| | | | | | | | Remove the unnecessary indirection through ao fields. Also fix the inverted result of AOCONTROL_HAS_TEMP_VOLUME. Hopefully the change is equivalent. But actually, it looks like the old code did it wrong.
* audio/out: make draining a separate operationwm42014-03-091-1/+1
| | | | | | | | | | | | Until now, this was always conflated with uninit. This was ugly, and also many AOs emulated this manually (or just ignored it). Make draining an explicit operation, so AOs which support it can provide it, and for all others generic code will emulate it. For ao_wasapi, we keep it simple and basically disable the internal draining implementation (maybe it should be restored later). Tested on Linux only.
* audio/out: make ao struct opaquewm42014-03-091-0/+1
| | | | | | We want to move the AO to its own thread. There's no technical reason for making the ao struct opaque to do this. But it helps us sleep at night, because we can control access to shared state better.
* Split mpvcore/ into common/, misc/, bstr/wm42013-12-171-1/+1
|
* Move options/config related files from mpvcore/ to options/wm42013-12-171-1/+1
| | | | | | | | | Since m_option.h and options.h are extremely often included, a lot of files have to be changed. Moving path.c/h to options/ is a bit questionable, but since this is mainly about access to config files (which are also handled in options/), it's probably ok.
* audio/out: prepare for non-interleaved audiowm42013-11-121-4/+4
| | | | | | | | | | | | | | | | | | | This comes with two internal AO API changes: 1. ao_driver.play now can take non-interleaved audio. For this purpose, the data pointer is changed to void **data, where data[0] corresponds to the pointer in the old API. Also, the len argument as well as the return value are now in samples, not bytes. "Sample" in this context means the unit of the smallest possible audio frame, i.e. sample_size * channels. 2. ao_driver.get_space now returns samples instead of bytes. (Similar to the play function.) Change all AOs to use the new API. The AO API as exposed to the rest of the player still uses the old API. It's emulated in ao.c. This is purely to split the commits changing all AOs and the commits adding actual support for outputting N-I audio.
* audio/out: reject non-interleaved formatswm42013-11-121-0/+3
| | | | | | | | | | No AO can handle these, so it would be a problem if they get added later, and non-interleaved formats get accepted erroneously. Let them gracefully fall back to other formats. Most AOs actually would fall back, but to an unrelated formats. This is covered by this commit too, and if possible they should pick the interleaved variant if a non-interleaved format is requested.
* audio/out: remove useless info struct and redundant fieldswm42013-10-231-6/+2
|
* audio/out: add sndio supportChristian Neukirchen2013-10-031-0/+340
Based on an earlier patch for mplayer by Alexandre Ratchov <alex@caoua.org>