summaryrefslogtreecommitdiffstats
path: root/audio/out
Commit message (Collapse)AuthorAgeFilesLines
* ao_wasapi: fix includeswm42013-12-181-3/+2
| | | | Broken due to recent header renaming. Untested.
* Split mpvcore/ into common/, misc/, bstr/wm42013-12-1717-26/+26
|
* Move options/config related files from mpvcore/ to options/wm42013-12-1715-17/+17
| | | | | | | | | 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.
* Move mpvcore/input/ to input/wm42013-12-171-1/+1
|
* Replace mp_tmsg, mp_dbg -> mp_msg, remove mp_gtext(), remove set_osd_tmsgwm42013-12-161-2/+2
| | | | | | | | | The tmsg stuff was for the internal gettext() based translation system, which nobody ever attempted to use and thus was removed. mp_gtext() and set_osd_tmsg() were also for this. mp_dbg was once enabled in debug mode only, but since we have log level for enabling debug messages, it seems utterly useless.
* ao_wasapi: Fix mistaken behavior on uninitDiogo Franco (Kovensky)2013-12-081-2/+2
| | | | | The parameter, when true, tells whether uninit should block for flushing the buffers, not whether it should quit immediately without flushing.
* ao_wasapi: handle AOPLAY_FINAL_CHUNKDiogo Franco (Kovensky)2013-12-081-2/+6
| | | | | Used for writing down all samples to the audio driver, even if it's not a full chunk; needed at EOF on weird files.
* ao_wasapi: Reduce the buffer size to a sane valueDiogo Franco (Kovensky)2013-12-081-1/+1
| | | | | | | The previous RING_BUFFER_COUNT value, 64, would have ao_wasapi buffer 64 frames of audio in the ring buffer; a delay of 1280ms, which is clearly overkill for everything. A value of 8 buffers 8 frames for a total of 160ms.
* ao_wasapi: fix audio buffering delay calculationDiogo Franco (Kovensky)2013-12-081-1/+1
| | | | | | | | When get_space was converted to returning samples instead of bytes, a unit type mismatch in get_delay's calculation returned bogus values. Fix by converting get_space's value back to bytes. Fixes playback with ao_wasapi when reaching EOF, or seeking past it.
* ao_oss: when falling back from unknown prefer larger formatbugmen0t2013-12-041-0/+16
|
* ao_oss: add 24bit formatsbugmen0t2013-12-041-0/+12
|
* options: add options that set defaults for af/vf/ao/vowm42013-12-011-0/+2
| | | | | | | | There are some use cases for this. For example, you can use it to set defaults of automatically inserted filters (like af_lavrresample). It's also useful if you have a non-trivial VO configuration, and want to use --vo to quickly change between the drivers without repeating the whole configuration in the --vo argument.
* ao_oss: add 6.1 and 7.1 speaker placement from FreeBSDbugmen0t2013-11-301-1/+15
|
* ao_oss: SNDCTL_DSP_CHANNELS takes int, not uint8_twm42013-11-301-2/+3
| | | | | | | This caused weird issue, probably caused by setting up the wrong number of channels, or similar. See github issue #383. Patch by bugmen0t on github.
* ao_alsa: remove unneeded checkswm42013-11-301-19/+11
| | | | | If initialization succeeds, p->alsa should always be set. Additional checks are not needed, and also this wasn't even done consistently.
* ao_alsa: enable "plug" for non-interleaved float formats toowm42013-11-301-2/+1
| | | | | | I have no idea what this code does, but it seems logical it should be active for all float formats, not just for float with interleaved access.
* ao_alsa: disable ALSA resampling by default againwm42013-11-291-0/+9
| | | | | | | | | | | | | | | | | | | | | This partially reverts commit 7d152965. It turns out that at least some ALSA drivers (at least snd-hda-intel) report incorrect audio delay with non-native sample rates, even if the sample rate is only very slightly different from the native one. For example, 48000Hz is fine on my hda-intel system, while both 8000Hz and 47999Hz lead to a delay off by 40ms (according to mpv's A/V difference display), which suggests that something in ALSA is calculating the delay using the wrong sample rate. As an additional problem, with ALSA resampling enabled, using 48001Hz/float/2ch fails, while 49000Hz/float/2ch or 48001Hz/s16/2ch work. With resampling disabled, all these cases work obviously, because our own resampler doesn't just refuse any of these formats. Since some people want to use the ALSA resampler (because it's highly configurable, supports multiple backends, etc.), we still allow enabling ALSA resampling with an ao_alsa suboption.
* ao_coreaudio: simplify ch label to speaker id conversionStefano Pigozzi2013-11-271-23/+37
| | | | | | | | Previous code was using the values of the AudioChannelLabel enum directly to create the channel bitmap. While this was quite smart it was pretty unreadable and fragile (what if Apple changes the values of those enums?). Change it to use a 'dumb' conversion table.
* ao_coreaudio: map channel labels needed for 8ch layoutsStefano Pigozzi2013-11-271-4/+30
| | | | | | The code stopped at kAudioChannelLabel_TopBackRight and missed mapping for 5 more channel labels. These are in a completely different order that the mpv ones so they must be mapped manually.
* ao_alsa: do not forcibly disable ALSA resamplingMartin Herkt2013-11-261-6/+0
| | | | | | | | Resampling with non-ancient ALSA setups works fine, so there is no need to keep this around. Furthermore, as of writing, the default builtin resampler used by many ALSA setups (taken from libspeex) actually has higher quality than the default resampling modes of avresample and swresample.
* ao_rsound: fix option typeswm42013-11-231-2/+2
| | | | | | These are option values, and the option code expects char*. Not actually tested.
* ao_null: fix simulated buffer sizewm42013-11-191-1/+1
| | | | | The size accidentally defaulted to 200 seconds instead of 200 milliseconds, which had fatal consequences when trying to use it.
* ao_null: properly simulate final chunk, add buffer optionswm42013-11-171-19/+50
| | | | | | | | | | Simulate proper handling of AOPLAY_FINAL_CHUNK. Print when underruns occur (i.e. running out of data). Add some options that control simulated buffer and outburst sizes. All this is useful for debugging and self-documentation. (Note that ao_null always was supposed to simulate an ideal AO, which is the reason why it fools people who try to use it for benchmarking video.)
* ao_lavc: use af_format_conversion_score()wm42013-11-161-26/+29
| | | | | | | | | | This should allow it to select better fallback formats, instead of picking the first encoder sample format if ao->format is not equal to any of the encoder sample formats. Not sure what is supposed to happen if the encoder provides no compatible sample format (or no sample format list at all), but in this case ao_lavc.c still fails gracefully.
* ao_lavc: write the final audio chunks from uninit()Rudolf Polzer2013-11-161-7/+10
| | | | | | | | | These must be written even if there was no "final frame", e.g. due to the player being exited with "q". Although the issue is mostly of theoretical nature, as most audio codecs don't need the final encoding calls with NULL data. Maybe will be more relevant in the future.
* ao_lavc: fix crash with interleaved audio outputs.Rudolf Polzer2013-11-161-2/+4
|
* audio: drop "_NE"/"ne" suffix from audio formatswm42013-11-154-16/+16
| | | | | | You get the native format by not appending any suffix to the format. This change includes user-facing names, e.g. for the --format option.
* ao_alsa: non-interleaved access is not always availablewm42013-11-141-0/+5
| | | | | | I thought this would always work... how disappointing. Revert to interleaved format if requesting non-interleaved fails.
* ao_null: add untimed sub-optionwm42013-11-131-2/+18
|
* ao_null: support pausing properlywm42013-11-131-4/+14
| | | | | | ao_null should simulate a "perfect" AO, but framestepping behaved quite badly with it. Framstepping usually exposes problems with AOs dropping their buffers on pause, and that's what happened here.
* ao_lavc: support non-interleaved audiowm42013-11-131-193/+42
|
* Merge branch 'planar_audio'wm42013-11-1217-270/+334
|\ | | | | | | | | Conflicts: audio/out/ao_lavc.c
| * ao_jack: switch from interleaved to planar audioWilliam Light2013-11-121-95/+92
| |
| * ao_jack: refactoring, also fix "no-connect" optionWilliam Light2013-11-121-57/+97
| |
| * ao_openal: support non-interleaved outputwm42013-11-121-18/+11
| | | | | | | | | | | | Since ao_openal simulates multi-channel audio by placing a bunch of mono-sources in 3D space, non-interleaved audio is a perfect match for it. We just have to remove the interleaving code.
| * ao_alsa: support non-interleaved audiowm42013-11-121-25/+23
| | | | | | | | | | | | | | | | ALSA supports non-interleaved audio natively using a separate API function for writing audio. (Though you have to tell it about this on initialization.) ALSA doesn't have separate sample formats for this, so just pretend to negotiate the interleaved format, and assume that all non-interleaved formats have an interleaved companion format.
| * ao_null: support non-interleaved audiowm42013-11-121-17/+20
| | | | | | | | Simply change internals from using byte counts to sample counts.
| * audio: switch output to mp_audio_bufferwm42013-11-122-8/+10
| | | | | | | | | | | | Replace the code that used a single buffer with mp_audio_buffer. This also enables non-interleaved output operation, although it's still disabled, and no AO supports it yet.
| * audio/out: prepare for non-interleaved audiowm42013-11-1217-85/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1213-1/+25
| | | | | | | | | | | | | | | | | | | | 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.
* | ao_lavc: remove audio offset hack to ease supporting planar audio.Rudolf Polzer2013-11-111-66/+11
|/ | | | | | | | Now to shift audio pts when outputting to e.g. avi, you need an explicit facility to insert/remove initial samples, to avoid initial regions of the video to be sped up/slowed down. One such facility is the delay filter in libavfilter.
* ao: add ao_play_silence, use for ao_alsa and ao_osswm42013-11-104-13/+20
| | | | | Also add a corresponding function to audio/format.c, which fills an audio block with silence.
* player: set PulseAudio stream title to window titlewm42013-11-102-0/+15
| | | | | | | Set the PulseAudio stream title, just like the VO window title is set. Refactor update_vo_window_title() so that we can use it for AOs too. The ao_pulse.c bit is stolen from MPlayer.
* ao_alsa: use correct magic spdif flagswm42013-11-091-14/+11
| | | | | I accidentally copied the AES4/ORIGFS constants from the ALSA headers, instead of the AES3/FS ones. The difference is probably important.
* ao: print requested audio format on initwm42013-11-093-6/+4
| | | | Also remove the rather bad/incomplete log calls from ao_alsa and ao_oss.
* ao_alsa: add magic spdif parameterswm42013-11-091-1/+25
| | | | | | | | | | | | | | I have no idea what these do, but apparently they are needed to inform ALSA about spdif configuration. First, replace the literal constant "6" for the AES0 parameter with the symbolic constants from the ALSA headers (the final value is the same). Second, copy paste some funky looking parameter setup from VLC's alsa output for setting the AES1, AES2, AES3 parameters. (The code is actually not literally copy-pasted, but does exactly the same.) My small but non-zero hope is that this could make DTS-HD work, or at least work into that direction. I can't test spdif stuff though, and for DTS-HD not even opening the ALSA device succeeds on my system.
* ao_alsa: redo the way parameters are added in the spdif casewm42013-11-091-38/+24
| | | | | | | | | | | Using spdif with alsa requires adding magic parameters to the device name, and the existing code tried to deal with the situation when the user wanted to add parameters too. Rewrite this code, in particular remove the duplicated parameter string as preparation for the next commit. The new code is a bit stricter, e.g. it doesn't skip spaces before and after '{' and '}'. (Just don't add spaces.)
* audio: don't let ao_lavc access frontend internals, change gapless audiowm42013-11-083-35/+33
| | | | | | | | | | | | | | | | | | | | | | | ao_lavc.c accesses ao->buffer, which I consider internal. The access was done in ao_lavc.c/uninit(), which tried to get the left-over audio in order to write the last (possibly partial) audio frame. The play() function didn't accept partial frames, because the AOPLAY_FINAL_CHUNK flag was not correctly set, and handling it otherwise would require an internal FIFO. Fix this by making sure that with gapless audio (used with encoding), the AOPLAY_FINAL_CHUNK is set only once, instead when each file ends. Basically, move the hack in ao_lavc's uninit to uninit_player. One thing can not be entirely correctly handled: if gapless audio is active, we don't know really whether the AO is closed because the file ended playing (i.e. we want to send the buffered remainder of the audio to the AO), or whether the user is quitting the player. (The stop_play flag is overwritten, fixing that is perhaps not worth it.) Handle this by adding additional code to drain the AO and the buffers when playback is quit (see play_current_file() change). Test case: mpv avdevice://lavfi:sine=441 avdevice://lavfi:sine=441 -length 0.2267 -gapless-audio
* audio: replace af_fmt2str_short -> af_fmt_to_strwm42013-11-075-13/+13
| | | | Also, remove all af_fmt2str usages.
* ao_oss: fix previous ao_oss commitwm42013-11-061-1/+0
| | | | | Basically I introduced an inverted condition, and the line removed was inactive before commit ce72aaa.
* ao_oss: hide warningwm42013-11-061-2/+2
|
* ao_oss: don't enable -softvol by default on OSSv4bugmen0t2013-11-061-0/+4
|
* ao_oss: make no_persistent_volume volume work when seekingbugmen0t2013-11-061-0/+4
|
* osx: fix -Wshadow warnings on platform specific codeStefano Pigozzi2013-11-041-3/+3
|
* configure: uniform the defines to #define HAVE_xxx (0|1)Stefano Pigozzi2013-11-032-18/+18
| | | | | | | | | | | | | | | | | | | | | The configure followed 5 different convetions of defines because the next guy always wanted to introduce a new better way to uniform it[1]. For an hypothetic feature 'hurr' you could have had: * #define HAVE_HURR 1 / #undef HAVE_DURR * #define HAVE_HURR / #undef HAVE_DURR * #define CONFIG_HURR 1 / #undef CONFIG_DURR * #define HAVE_HURR 1 / #define HAVE_DURR 0 * #define CONFIG_HURR 1 / #define CONFIG_DURR 0 All is now uniform and uses: * #define HAVE_HURR 1 * #define HAVE_DURR 0 We like definining to 0 as opposed to `undef` bcause it can help spot typos and is very helpful when doing big reorganizations in the code. [1]: http://xkcd.com/927/ related
* ao_pulse: fix channel layoutswm42013-10-311-1/+4
| | | | | | | | The code was selecting PA_CHANNEL_POSITION_MONO for MP_SPEAKER_ID_FC, which is correct only with the "mono" channel layout, but not anything else. Remove the mono entry, and handle mono separately. See github issue #326.
* ao_alsa: return negative value on error in play()wm42013-10-301-3/+3
| | | | | No functional change, because the only user of ao_play() ignores return values below 1.
* ao_alsa: don't include alloca.hwm42013-10-251-1/+0
| | | | | | | | It's true that ALSA uses alloca() in some of its API functions, but since this is hidden behind macros in the ALSA headers, we have no reason to include alloca.h ourselves. Might help with portability (FreeBSD).
* audio/out: remove useless info struct and redundant fieldswm42013-10-2317-105/+44
|
* ao_pcm: big endian AC3 in wav doesn't workwm42013-10-221-1/+0
| | | | | | | | At least not with ffmpeg. Honestly, I have no idea how little endian AC3 works at all, since ao_pcm doesn't do anything special about it, and treats it like s16le. Maybe it's broken and ffmpeg has special logic to detect it.
* mp_msg: remove gettext() supportwm42013-10-181-1/+1
| | | | | | | | | Was disabled by default, was never used, internal support was inconsistent and poor, and there has been virtually no interest in creating translations. And I don't even think that a terminal program should be translated. This is something for (hypothetical) GUIs.
* ao_coreaudio: clear output buffer on buffer underrunStefano Pigozzi2013-10-031-0/+1
| | | | | | | | Output silence to the output buffer during underruns. This removes small occasional glitches that happen before the AUHAL is actually paused from the `audio_pause` call. Fixes #269
* audio/out: add sndio supportChristian Neukirchen2013-10-032-0/+344
| | | | Based on an earlier patch for mplayer by Alexandre Ratchov <alex@caoua.org>
* ao_coreaudio: fetch device name only for verbose log levelStefano Pigozzi2013-10-011-6/+8
| | | | | The previous code fetched the device name regardless of log level and then only printed it if log level was verbose.
* 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
| | |