summaryrefslogtreecommitdiffstats
path: root/audio/out
Commit message (Collapse)AuthorAgeFilesLines
* 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
| | | | | 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
|
* mixer: make struct opaquewm42013-09-202-2/+0
| | | | Also remove stray include statements from ao_alsa and ao_oss.
* 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-0616-40/+40
| | | | 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
| |
* | 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
* 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.