summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_audiotrack.c
Commit message (Collapse)AuthorAgeFilesLines
* ao: rename playthread to ao_threadnanahi2024-04-101-2/+2
| | | | | | | "playthread" is a confusing name which doesn't describe what it really is. Rename it to ao_thread, and ao_wakeup_playthread to ao_wakeup, in the same style as VO threads. This makes call stack function names less confusing.
* various: fix -Wold-style-declaration warningnanahi2024-03-191-9/+9
| | | | warning: `static' is not at beginning of declaration
* misc/jni: reduce duplication in mapping structsfan52024-02-281-66/+66
| | | | | 'name' was in fact unused when reading fields or methods, so it can be merged with 'method'. Also changed the type of 'mandatory' to bool.
* misc/jni: introduce macros for deleting referencessfan52024-02-281-43/+24
|
* ao_audiotrack: refactor JNI class retrievalsfan52024-02-281-68/+77
| | | | | | - split mapping from field struct - mark field struct static - define list of classes to reduce more repetitive code
* ao_audiotrack: remove two dead variablessfan52024-02-281-9/+0
|
* ao_audiotrack: fix missing check for passthrough supportsfan52024-02-281-0/+4
|
* ao_audiotrack: switch to ao_read_data_nonblocking()Thomas Weißschuh2023-11-081-1/+1
|
* ALL: use new mp_thread abstractionKacper Michajłow2023-11-051-20/+19
|
* mp_threads: rename threads for consistent naming across all of themKacper Michajłow2023-10-271-1/+1
| | | | | | | | I'd like some names to be more descriptive, but to work with 15 chars limit we have to make some sacrifice. Also because of the limit, remove the `mpv/` prefix and prioritize actuall thread name.
* ao: convert all timing code to nanosecondsDudemanguy2023-10-161-3/+3
| | | | | | | Pull AOs work off of a callback that relies on mpv's internal timer. So like with the related video changes, convert all of these to nanoseconds instead. In many cases, the underlying audio API does actually provide nanosecond resolution as well.
* timer: teach it about nanosecondsKacper Michajłow2023-09-291-1/+1
| | | | | Those changes will alow to change vsync base to more precise time base. In general there is no reason to truncate values returned by system.
* ao_audiotrack: convert to nanosecondsKacper Michajłow2023-09-291-14/+14
|
* ao_audiotrack: enable pcm-float by defaultsfan52023-08-081-0/+3
| | | | Since recent commits this should work 100% as well as s16.
* ao_audiotrack: support more channel layoutssfan52023-08-081-25/+39
|
* ao_audiotrack: support media rolesfan52023-08-081-1/+5
| | | | maybe this is good for something, who knows
* ao_audiotrack: don't ignore ao_read_data return valuesfan52023-08-081-2/+1
| | | | | | | | The difference this makes is that the OS API will notice when we underrun (as opposed to being fed silence). Other AOs mostly seem to not do this because they've committed to filling a buffer of a certain size no matter what, but I have not observed any ill effects for AudioTrack in my testing.
* ao_audiotrack: allow byte buffer data transfer for float samplessfan52023-08-081-12/+15
|
* ao_audiotrack: align buffer size to sample sizesfan52023-08-081-2/+8
| | | | | | This looks like a pretty bad bug but only became a problem with the last commit that allows rates like 22.5kHz to pass through directly instead of being resampled.
* ao_audiotrack: do not needlessly resamplesfan52023-08-081-1/+1
| | | | | Resampling when the driver says it isn't outputting more than a certain rate anyway makes sense, the inverse does not.
* ao_audiotrack: fix broken exception checkssfan52023-08-081-3/+3
| | | | | The exception always has to be checked and cleared even if we can already see that no valid value was returned.
* ao_audiotrack: remove unused writeV23sfan52023-08-081-2/+0
| | | | | The piece of code where it would make sense to use this never runs with API 21 or newer, so calling it there would be useless.
* options: transition options from OPT_FLAG to OPT_BOOLChristoph Heinrich2023-02-211-2/+2
| | | | | | c78482045444c488bb7948305d583a55d17cd236 introduced a bool option type as a replacement for the flag type, but didn't actually transition and remove the flag type because it would have been too much mundane work.
* ao_audiotrack: replace malloc with tallocsfan52023-01-121-6/+1
|
* ao_audiotrack: change buffer sizing logicAman Karmani2021-10-211-2/+2
| | | | | | | | Previously number of channels was being ignored. The buffer will now be between 75ms and 150ms Signed-off-by: Aman Karmani <aman@tmm1.net>
* ao_audiotrack: allocate chunk buffer based on negotiated sizeAman Karmani2021-10-211-2/+3
| | | | Signed-off-by: Aman Karmani <aman@tmm1.net>
* ao_audiotrack: support delay up to 2s as normalAman Karmani2021-10-211-2/+2
| | | | | | Fixes issues streaming to echo speaker pair from firetv devices. Signed-off-by: Aman Karmani <aman@tmm1.net>
* ao_audiotrack: set device_buffer based on underlying buffer size when availableAman Karmani2021-10-211-0/+10
| | | | Signed-off-by: Aman Karmani <aman@tmm1.net>
* ao_audiotrack: use new style initializer for AudioTrack when availableAman Karmani2021-10-211-11/+114
| | | | | | Fixes deprecation warnings printed when using this driver. Signed-off-by: Aman Karmani <aman@tmm1.net>
* audio: redo internal AO APIwm42020-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This affects "pull" AOs only: ao_alsa, ao_pulse, ao_openal, ao_pcm, ao_lavc. There are changes to the other AOs too, but that's only about renaming ao_driver.resume to ao_driver.start. ao_openal is broken because I didn't manage to fix it, so it exits with an error message. If you want it, why don't _you_ put effort into it? I see no reason to waste my own precious lifetime over this (I realize the irony). ao_alsa loses the poll() mechanism, but it was mostly broken and didn't really do what it was supposed to. There doesn't seem to be anything in the ALSA API to watch the playback status without polling (unless you want to use raw UNIX signals). No idea if ao_pulse is correct, or whether it's subtly broken now. There is no documentation, so I can't tell what is correct, without reverse engineering the whole project. I recommend using ALSA. This was supposed to be just a simple fix, but somehow it expanded scope like a train wreck. Very high chance of regressions, but probably only for the AOs listed above. The rest you can figure out from reading the diff.
* options: change option macros and all option declarationswm42020-03-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change all OPT_* macros such that they don't define the entire m_option initializer, and instead expand only to a part of it, which sets certain fields. This requires changing almost every option declaration, because they all use these macros. A declaration now always starts with {"name", ... followed by designated initializers only (possibly wrapped in macros). The OPT_* macros now initialize the .offset and .type fields only, sometimes also .priv and others. I think this change makes the option macros less tricky. The old code had to stuff everything into macro arguments (and attempted to allow setting arbitrary fields by letting the user pass designated initializers in the vararg parts). Some of this was made messy due to C99 and C11 not allowing 0-sized varargs with ',' removal. It's also possible that this change is pointless, other than cosmetic preferences. Not too happy about some things. For example, the OPT_CHOICE() indentation I applied looks a bit ugly. Much of this change was done with regex search&replace, but some places required manual editing. In particular, code in "obscure" areas (which I didn't include in compilation) might be broken now. In wayland_common.c the author of some option declarations confused the flags parameter with the default value (though the default value was also properly set below). I fixed this with this change.
* audio: add ao_audiotrack for androidAman Gupta2019-11-191-0/+717