0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00
Commit Graph

827 Commits

Author SHA1 Message Date
wm4
c6c46f5aa7 ao_lavc: fix setting up AVFrame pointers
The caller set up the "start" pointer array using the number of planes,
the encode() function used the number of channels. This copied
uninitialized values for packed formats, which makes Coverity warn.
2014-11-21 10:09:25 +01:00
wm4
c01a62efbc af_scaletempo: use float division for rate
From what I understand the division is to align the dimension of the
value from seconds to milliseconds. Hard to tell whether the "rounding"
was intentional or not; I'm tipping on "not".

Found by Coverity.
2014-11-21 10:09:15 +01:00
wm4
e082c2c3df Remove some unneeded NULL checks
Found by Coverity; also see commit 85fb2af3.
2014-11-21 09:58:09 +01:00
wm4
524aa99401 audio/out/push: fix off-by-one error
Needs 1 additional free entry.

Found by Coverity.
2014-11-21 03:50:57 +01:00
wm4
459f3aa4f9 ao_lavc: fix dangling pointers
Found by Coverity.
2014-11-21 03:50:52 +01:00
Kevin Mitchell
f2dda72dbc ao/wasapi: only retry resizing the buffer once
like the MSDN example:

http://msdn.microsoft.com/en-us/library/windows/desktop/dd370875%28v=vs.85%29.aspx
2014-11-18 07:50:51 -08:00
Kevin Mitchell
da03334a73 ao/wasapi: keep bufferPeriod in sync on retry
Without this, the retry will fail if they are not equal or
bufferPeriod is zero.
2014-11-18 06:59:26 -08:00
Kevin Mitchell
94ea4435a9 ao/wasapi: refix printf warning for both cygwin and msys
a cast to (unsigned) should do "the right thing".
2014-11-18 05:03:33 -08:00
Kevin Mitchell
19e9c9d1be ao/wasapi: periodicity in shared mode must be zero
IAudioClient::Initialize hnsPeriodicity argument is nonzero only for exclusive mode

http://msdn.microsoft.com/en-us/library/windows/desktop/dd370805%28v=vs.85%29.aspx
2014-11-18 05:03:33 -08:00
Kevin Mitchell
c545c406fa ao/wasapi: increase buffer size to 50 ms
Before it was the default device period, which was too small
causing glitches on on entering/exiting fullscreen.
2014-11-18 05:03:33 -08:00
wm4
d96bd0eaa8 audio/out: always log retrieved audio device size 2014-11-18 12:51:43 +01:00
Jonathan Yong
7697d300d2 ao/wasapi: fix leaked marshaled interface streams
Signed-off-by: Kevin Mitchell <kevmitch@gmail.com>
2014-11-18 02:12:28 -08:00
Kevin Mitchell
22bf0a78df ao/wasapi: Don't free stuff the thread may still be using on timeout
In the unlikely event of a timeout waiting for the audio thread to return,
don't free stuff that it may still be using.
2014-11-17 23:46:38 -08:00
Kevin Mitchell
20d42b3475 ao/wasapi: also free the threadLoop handle on uninit
http://msdn.microsoft.com/en-us/library/windows/desktop/ms682453%28v=vs.85%29.aspx
2014-11-17 23:43:51 -08:00
Kevin Mitchell
23f52fd41b ao/wasapi: fix leaked event handles 2014-11-17 23:32:28 -08:00
Kevin Mitchell
ebd161b256 ao/wasapi: fix race condition in uninit on failure.
When the audio thread fails to properly init, it signals failure
to the main thread, AND THEN starts to clean up. For this to work,
ao_init callback must not return until the thread's cleanup is finished.
This is correctly handled in the ao_uninit callback by waiting for
the thread to exit, so just call that to clean up the main thread.
I have no idea why I didn't do this in the first place.
2014-11-17 23:32:13 -08:00
James Ross-Gowan
d9bac96a9d ao/wasapi: silence format string warnings 2014-11-18 12:19:36 +11:00
wm4
fb86750a67 ao_alsa: check for EAGAIN too
Simply retry on EAGAIN.

I've seen this in several other projects; it might be just cargo-culting
though.
2014-11-17 20:07:59 +01:00
wm4
8b2798cb3e audio/out: switch back to wasapi as default on win32
dsound was set as default, because there were some hard to fix problems
with wasapi. These problems were probably fixed now, so let's try with
wasapi as default again.
2014-11-17 14:07:11 +01:00
Kevin Mitchell
4c8b841fc4 ao/wasapi: request ao reload on thread_feed failures
Even with change notifications, there are still (rare) cases when the
feed thread gets AUDCLIENT_DEVICE_INVALIDATED. So handle failures in
thread_feed by requesting ao_reload.
2014-11-17 04:31:22 -08:00
Kevin Mitchell
9371990bd1 ao/wasapi: add retry loop on AUDCLNT_E_DEVICE_IN_USE
this works around reinitializing too fast on device property changes
2014-11-17 04:31:22 -08:00
Kevin Mitchell
6c512892d4 ao/wasapi: request reset on appropriate events
on changes to PKEY_AudioEngine_DeviceFormat, device status, and default device.
call ao_reload directly in the change_notify "methods".

this requires keeping a device enumerator around for the duration of
execution, rather than just for initially querying devices
2014-11-17 04:31:20 -08:00
Kevin Mitchell
e647f202ed ao/wasapi: add convenience functions for change notifiy 2014-11-17 04:30:53 -08:00
Jonathan Yong
f29f16663a ao/wasapi: new wasapi device monitoring interface
Implement skeleton IMMNotificationClient to watch for changes in the
sound device.  This will make recovery possible from changes shared
mode sample rate, bit depth, "enhancements"/effects and even graceful
device removal.

http://msdn.microsoft.com/en-us/library/windows/desktop/dd371417%28v=vs.85%29.aspx

Signed-off-by: Kevin Mitchell <kevmitch@gmail.com>
2014-11-17 04:30:53 -08:00
Kevin Mitchell
497df443c0 ao/wasapi: look for "multimedia" default device instead of "console"
console is more for system notifications / voice command, mpv is most certainly multimedia

http://msdn.microsoft.com/en-us/library/windows/desktop/dd370842%28v=vs.85%29.aspx
2014-11-17 04:30:53 -08:00
Kevin Mitchell
e8dbdf1eb9 ao/wasapi: put loading of default device in it's own function 2014-11-17 04:30:47 -08:00
Kevin Mitchell
f7c26230eb ao/wasapi: fix possible null dereference of pDevice
IMMDeviceEnumerator::GetDefaultAudioEndpoint may set pDevice to null on failure.

http://msdn.microsoft.com/en-us/library/windows/desktop/dd371401%28v=vs.85%29.aspx
2014-11-17 04:13:52 -08:00
Kevin Mitchell
3da6f723c6 ao/wasapi: tidy up better on failure
Before, failures, particularly in the thread loop init, could lead to a
bad state for the duration of mpvs execution. Make sure that
everything that was initialized gets properly and safely
uninitialized.
2014-11-17 04:13:52 -08:00
Kevin Mitchell
e28102f1a8 ao/wasapi: improve error messages and add more debug statements
also enforce more consistency in the exit codes and error handling

thanks to Jonathan Yong <10walls@gmail.com>
2014-11-17 04:13:49 -08:00
Kevin Mitchell
d4393be0f9 ao/wasapi: make calling of thread_init consistent with thread_uninit 2014-11-17 03:37:07 -08:00
Kevin Mitchell
6eb5c6d186 ao/wasapi: reenable the reset function
the race condition that necessitated disabling
this was fixed in
e440352313
2014-11-17 03:37:07 -08:00
Jonathan Yong
227f0e3f39 ao/wasapi: fix leaked deviceID 2014-11-17 03:36:54 -08:00
wm4
be9eb08389 af: remove redundant function 2014-11-12 20:19:21 +01:00
wm4
a669a1d0dd af: check audio params for validity
Normally, these should be valid anyway, so this is just being cautious.
2014-11-12 20:03:04 +01:00
Rudolf Polzer
4f63a812de ao_lavc, vo_lavc: Fix crashes in case of multiple init attempts.
When initialization failed, vo_lavc may cause an irrecoverable state in
the ffmpeg-related structs. Therefore, we reject additional
initialization attempts at least until we know a better way to clean up
the mess.

ao_lavc currently cannot be initialized more than once, yet it's good to
do consistent changes there as well.

Also, clean up uninit-after-failure handling to be less spammy.
2014-11-12 12:16:07 +01:00
wm4
d4cc41bbcd audio: make sure AVFrame is actually refcounted
The mp_audio_from_avframe() function requires the AVFrame to be
refcounted, and merely increases its refcount while referencing the same
data. For non-refcounted frames, it simply did nothing and potentially
would make the caller pass around a frame with dangling pointers.

(libavcodec should always return refcounted frames, but it's not clear
what other code does; and also the function should simply work, instead
of having weird requirements on its arguments.)
2014-11-11 21:20:21 +01:00
wm4
475226c783 audio: refuse to allocate frames in invalid format 2014-11-11 21:10:53 +01:00
wm4
5fd8a1e04c audio: make decoders output refcounted frames
This rewrites the audio decode loop to some degree. Audio filters don't
do refcounted frames yet, so af.c contains a hacky "emulation".

Remove some of the weird heuristic-heavy code in dec_audio.c. Instead of
estimating how much audio we need to filter, we always filter full
frames. Maybe this should be adjusted later: in case filtering increases
the volume of the audio data, we should try not to buffer too much
filter output by reducing the input that is fed at once.

For ad_spdif.c and ad_mpg123.c, we don't avoid extra copying yet - it
doesn't seem worth the trouble.
2014-11-10 22:02:05 +01:00
wm4
46d6fb9dc1 audio: add mp_audio_make_writeable() 2014-11-10 22:02:05 +01:00
wm4
c1b034f2aa audio: clear buffer array too with mp_audio_set_null_data() 2014-11-10 22:02:05 +01:00
wm4
e094e9cb75 audio: change how filters are inserted on playback speed changes
Use a pseudo-filter when changing speed with resampling, instead of
somehow changing a samplerate somewhere. This uses the same underlying
mechanism, but is a bit more structured and cleaner. It also makes some
of the following changes easier.

Since we now always use filters to change audio speed, move most of the
work set_playback_speed() does to recreate_audio_filters().
2014-11-10 22:02:05 +01:00
wm4
995a6af787 af_format: remove redundant message prefixes 2014-11-10 22:02:04 +01:00
wm4
0b26d8c666 audio: add function to convert AVFrame to mp_audio references
This is somewhat duplicated from ad_lavc.c and af_lavfi.c, but will
eventually be used by both.
2014-11-10 22:02:04 +01:00
wm4
5d46e44160 audio: add mp_audio_pool
A helper to allocate refcounted audio frames from a pool. This will
replace the static buffer many audio filters use (af->data), because
such static buffers are incompatible with refcounting.
2014-11-10 18:15:22 +01:00
wm4
9388f69f67 audio: use AVBufferRef to allocate audio frames
A first step towards refcounted audio frames.

Amazingly, the API just does what we want, and the code becomes
simpler. We will need to NIH allocation from a pool, though.
2014-11-10 10:43:15 +01:00
wm4
e440352313 audio/out/pull: avoid deadlock if audio callback stops
If the audio callback suddenly stops, and the AO provides no "reset"
callback, then reset() could deadlock by waiting on the audio callback
forever.

The waiting was needed to enter a consistent state, where the audio
callback guarantees it won't access the ringbuffer. This in turn is
needed because mp_ring_reset() is not concurrency-safe.

This active waiting is unavoidable. But the way it was implemented, the
audio callback had to call ao_read_data() at least once when reset() is
called. Fix this by making ao_read_data() set a flag upon entering and
leaving, which basically turns p->state into some sort of spinlock.

The audio callback actually never needs to spin, because there are only
2 states: playing audio, or playing silence. This might be a bit
surprising, because usually atomic_compare_exchange_strong() requires a
retry-loop idiom for correct operation.

This commit is needed because ao_wasapi can (or will in the future)
randomly stop the audio callback in certain corner cases. Then the
player would hang forever in reset().
2014-11-09 15:23:40 +01:00
wm4
5db0fbd95e audio/out: consistently use double return type for get_delay
ao_get_delay() returns double, but the get_delay callback still
returned float.
2014-11-09 11:45:04 +01:00
wm4
b021d038c2 audio/out: make ao_request_reload() idempotent
This is what you would expect. Before this commit, each
ao_request_reload() call would just queue a reload command, and then
recreate the AO for the number of times the function was called.

Instead of sending a command, introduce some sort of event retrieval
mechanism. At least for the reload case, use atomics, because we're too
lazy to setup an extra mutex.
2014-11-09 09:58:44 +01:00
wm4
b814b7ca84 audio: add --audio-client-name option
The main need I see for this is with libmpv - it would be confusing if
some application showed up as "mpv" on whateverthehell PulseAudio uses
it for (generally it does show up on various PA GUI tools).
2014-11-07 15:54:35 +01:00
wm4
a54b99d1e5 ao_oss: wait for events with poll()
The intention is to avoid using the timeout-based fallback.

There's some minor hope that this will help with OpenBSD (see #1239),
although it probably won't.

Some chance that this will cause trouble with obscure OSS
implementations or emulations.
2014-11-06 01:17:36 +01:00
wm4
3d2e278029 audio/out/push: when using audio wait fallback, recheck condition
If calling ao->driver->wait() fails, we need to fallback to timeout-
based waiting. But it could be that at this point, the mutex was already
released (and then re-acquired). So we need to recheck the condition in
order to avoid missed wakeups.

This probably wasn't an actually occurring problem, but still could
cause a small race-condition window if the dynamic fallback is actually
used.
2014-11-06 01:15:44 +01:00
wm4
93e1db0bff ad_lavc: allow skip samples amount to be larger than 1 packet
Apparently we actually need this. At least the following commit would
break without this.
2014-11-03 19:56:38 +01:00
wm4
8607b0c44b ao_alsa: don't make snd_pcm_hw_params_set_buffer_time_near() error fatal
Apparently this can "sometimes" return an error. In my opinion, this
should never return an error: neither the semantics of the function,
nor the ALSA documentation or ALSA sample code seem to indicate that
a failure is to be expected. I'm not perfectly sure about this though
(I blame ALSA being a weird, big, underdocumented API).

Since it causes problems for some users, and since there is really no
reason why we should abort on such an error, turn it into a warning.

Fixes #1231.
2014-10-31 01:09:53 +01:00
wm4
733936f376 options: accept --audio-channels=auto
This sounds much more intuitive, while "empty" was a bit of a WTF.
2014-10-30 22:58:17 +01:00
Stefano Pigozzi
0c0ff638a3 coreaudio: only list output devices 2014-10-28 14:11:50 +01:00
wm4
d5b081152a audio: add command/function to reload audio output
Anticipated use: simple solution for dealing with audio APIs which
request configuration changes via events.
2014-10-27 11:52:42 +01:00
wm4
809fbc6fc1 ao_alsa: move parameter append code to a function
Why not. (I thought I needed this, but my other experiments failed. So
this is merely a minor cleanup.)
2014-10-23 18:06:17 +02:00
Stefano Pigozzi
474461244e rename ao_coreaudio_device.c -> ao_coreaudio_exclusive.c
This is so that the source file name matches the AO name
2014-10-23 09:55:17 +02:00
Stefano Pigozzi
f8d0a75b50 coreaudio: redirect IEC61937 to coreaudio_exclusive 2014-10-23 09:16:39 +02:00
wm4
32720cdc17 audio/out: add redirection-on-init mechanism
Looks like this will help us with making --audio-device and spdif work
as expected on OSX. To be used ina  following commit.
2014-10-22 17:12:08 +02:00
wm4
42158b819a audio/out: missing error check
Oops.
2014-10-22 16:57:28 +02:00
wm4
67d63bc948 audio/out: don't add special devices to --audio-device list
Since the list associated with --audio-device is supposed to enable
simple user-selection, it doesn't make much sense to include overly
special things like ao_pcm or ao_null in the list. Specifically,
ao_pcm is harmful, because it will just dump all audio to a file
named audiodump.wav in the current working directory. The user can't
choose the filename (it can be customized, but not through this
option), and the working directory might be essentially random,
especially if this is used from a GUI.

Exclude "strange" entries. We reuse the fact that there's already a
simple list ordered by auto-probe priority in order to avoid having to
add an additional flag. This is also why coreaudio_exclusive was moved
above ao_null: ao_null ends auto-probing and marks the start of
"special" outputs, which don't show up on the device, but we want
coreaudio_exclusive to be selectable (I think).
2014-10-22 16:16:35 +02:00
wm4
2a74704d76 audio/out: include coreaudio_exclusive in auto-probing
Move it above ao_null, so that it can be selected during auto-probing
(even if it's only last). I see no reason why it should not be included,
and it makes the following commit slightly more elegant. (See
explanations there.)
2014-10-22 16:15:49 +02:00
wm4
9ba6641879 Set thread name for debugging
Especially with other components (libavcodec, OSX stuff), the thread
list can get quite populated. Setting the thread name helps when
debugging.

Since this is not portable, we check the OS variants in waf configure.
old-configure just gets a special-case for glibc, since doing a full
check here would probably be a waste of effort.
2014-10-19 23:48:40 +02:00
wm4
c854ce934e audio: quote devices in --audio-device=help
The output is a bit confusing. Quoting the device name probably helps a
little bit; also add minimal explanations to the manpage.
2014-10-19 16:36:38 +02:00
wm4
312531c08c audio/out/push: reset projected EOF time on new data
Seems like this could theoretically happen in low buffer situations, but
I haven't spotted this behavior in the wild.
2014-10-14 22:07:04 +02:00
wm4
e9b0a61444 ao_wasapi: implement device listing 2014-10-13 18:21:45 +02:00
wm4
fb7cc7274e ao_dsound: implement device listing 2014-10-13 18:21:35 +02:00
wm4
19f543ecbb ao_portaudio: implement device listing 2014-10-13 16:43:05 +02:00
wm4
859d02b40e ao_openal: implement device listing 2014-10-13 16:42:56 +02:00
wm4
2e52cc8f2e audio/out: add "auto" pseudo-device
Also, don't set an empty string for the fallback device if an AO doesn't
list any devices.
2014-10-13 16:42:44 +02:00
Stefano Pigozzi
7c07da57e3 coreaudio: use the new device selection API
The CoreAudio API is built around device IDs so we store the integer as string
and read it back.
2014-10-12 12:22:17 +02:00
wm4
240266d12c af_lavcac3enc: fix byte order
Oops.

Fixes #1172.

CC: @mpv-player/stable
2014-10-12 11:33:35 +02:00
wm4
04a5d25bf7 audio: don't list encoder AO with --audio-device=help 2014-10-10 19:45:25 +02:00
wm4
f432a584b9 ao_pulse: implement AO device listing API
While conceptually this sink stuff in PulseAudio does just the right
thing, actually listing the sinks is unbelievable complicated. Not only
is the idea that listing them should happen asynchronously completely
bullshit (who the fuck runs the PulseAudio server on a separate
computer), but the way this is done is full of bullshit too. Why
separate callbacks for each device? Why this obtuse mainloop shit?
Especially the mainloop shit makes it actively worse than doing things
manually with pthread primitives, and the reason for that (different
mainloop implementations for GUIs?) is laughable too. It's like they
chose the most complicated API possible just because they attempted
to "abstract" basic mechanisms in order to handle "everything". While
I don't claim to design the best APIs, this API is fucking terrible
without any excuse. (End of rant.)
2014-10-10 18:42:43 +02:00
wm4
a25e936540 ao_pulse: move setup code to separate function
All the dumb crap in pa_init_boilerplate() is needed to talk to the
audio server at all. Might also fix some subtle bugs in the init code
(which is strange, because the original file was contributed by the
devil himself).
2014-10-10 18:42:06 +02:00
wm4
edad4fc29b audio: change internal device listing API
Now we run ao_driver->list_devs on a dummy AO instance, which will
probably confuse everyone. This is done for the sake of PulseAudio.
2014-10-10 18:27:21 +02:00
wm4
26bc6b4831 Add some missing "const"s
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).
2014-10-10 13:44:08 +02:00
wm4
7e4491a7a7 audio/out/push: make draining slightly more robust
Don't wait after the audio thread has pushed the remaining audio to the
AO. Avoids hard hangs if the heuristic fails completely (could still
happen if get_delay returns absurd values).

CC: @mpv-player/stable
2014-10-10 13:21:43 +02:00
wm4
bd41fc7723 audio/out/push: fix EOF heuristic
Since the internal AO driver API has no proper way to determine EOF, we
need to guess by querying get_delay. But some AOs (e.g. ao_pulse with
no-latency-hacks set) may never reach 0, maybe because they naively add
the latency to the buffer level. In this case our heuristic can break.

Fix by always using the delay to estimate the EOF time. It's not even
that important - it's mostly used to avoid blocking draining. So this
should be ok.

CC: @mpv-player/stable (maybe)
2014-10-10 13:18:53 +02:00
Stefano Pigozzi
a8ec044d54 fix -Wvisibility warnings with clang
Now everything compiles with no warnings! yay!
2014-10-09 22:22:48 +02:00
wm4
f1efd83ef7 ao_alsa: implement device listing & selection
Unfortunately, ALSA is particularly bad with this, because mpv has to
add all sorts of magic crap to the device name to make things work. The
device selection overrides this, so explicitly selecting devices will
most likely break your audio. This has yet to be solved.
2014-10-09 21:22:44 +02:00
wm4
35649a990a audio: add device selection & listing with --audio-device
Not sure how good of an idea this is.

This commit doesn't add support for this to any AO yet; the AO
implementations will follow later.
2014-10-09 21:21:31 +02:00
wm4
4b2f81a36f ao_pulse: don't use pa_format_info_to_sample_spec()
This function is available starting with PulseAudio 2.0, while we only
require 1.0. This broke compilation on Ubuntu 12.04.5 LTS.

Use our own function to calculate the buffer size, which is actually
simpler and needs slightly less code.

Hopefully fixes #1154.
CC: @mpv-player/stable
2014-10-06 21:49:26 +02:00
wm4
9e3e5ca598 audio/out/push: fix some AOs freezing on exit
Caused by a dumb deadlock.
2014-10-05 23:05:54 +02:00
wm4
aeefb8511c audio/out/push: make draining more robust
It was more complicated than it had to be: the audio thread already
determines whether audio has ended, so we can use that. Remove the
separate logic for draining.
2014-10-05 00:31:20 +02:00
wm4
6431e09fb3 audio/out/push: limit fallback sleep time to reasonable limits 2014-10-05 00:13:00 +02:00
wm4
0d4e245de7 ao_pulse: change suspend circumvention logic
Commit 957097 attempted to use PA_STREAM_FAIL_ON_SUSPEND to make
ao_pulse exit if the stream was started suspended.

Unfortunately, PA_STREAM_FAIL_ON_SUSPEND is active even during playback.
If you pause mpv, pulseaudio will close the actual audio device after a
while (or something like this), and unpausing won't work. Instead, it
will spam "Entity killed" error messages.

Undo this change and check for suspended audio manually during init.

CC: @mpv-player/stable
2014-10-04 23:30:07 +02:00
wm4
f679c5de1b ad_lavc: avoid warning messages on older FFmpeg or Libav
If the flag doesn't exist, the av_opt_set() API will print warning
messages.
2014-10-04 12:30:34 +02:00
wm4
9570976255 ao_pulse: refuse to start suspended
Sometimes, ao_pulse starts in suspended mode, which means playback is
essentially paused in pulseaudio. This gives the impression that mpv is
hanging, since it times video against the audio playback progress, and
audio never makes progress in this state.

I'm not sure if this will help - possibly it does with mixed
pulseaudio/alsa setups. However, if the alsa setup has the pulseaudio
plugin, alsa will hang too. But there's still a chance we get less
blame for pulseaudio messes.
2014-10-03 23:04:12 +02:00
wm4
cf2add4ff9 audio: skip samples and adjust timestamps ourselves
This gets rid of this warning:

  Could not update timestamps for skipped samples.

This required an API addition to FFmpeg (otherwise it would instead
doing arithmetic on the timestamps itself), so whether it works depends
on the FFmpeg version.
2014-10-03 23:03:22 +02:00
wm4
b5942f80de audio/filter: allow removing filters by label
Although the "af" command already could do this, it seems it's better
to introduce a lower level mechanism for now. This avoids some messy
issues, since that code would recursive call reinit_audio_chain().

To be used by the next commit.
2014-10-02 02:50:12 +02:00
wm4
7dd3822d09 audio: refactor some aspects of filter chain setup
There's no real reason why audio_init_filter() should exist. Just use
af_init or af_reinit directly. (We lose a useless message; the same
information is printed in a quite close place with more details.)

Requires less code, and the way the filter chain is marked as having
failed to initialize allows just switching off audio instead of
crashing if trying to insert a volume filter in mixer.c fails, and
recreating the old filter chain fails too.
2014-10-02 02:42:23 +02:00
wm4
2e16dfbf93 audio/filter: don't wipe full filter chain if adding a filter fails
There's no need for that, and in fact makes it more likely that it
recovers normally.
2014-10-02 01:20:01 +02:00
wm4
650af29471 audio/out/push: clean up properly on init error
Close the wakeup pipes, free the mutex and condition var.
2014-09-27 04:54:17 +02:00
wm4
e79de41b97 audio/out: check device buffer size for push.c only
Should fix #1125.
2014-09-27 04:52:46 +02:00
wm4
d778130dc4 audio/out: disable ao_sndio by default
Don't build it, move it down the autoprobe list even if it's enabled. It
doesn't work well enough.
2014-09-26 15:52:29 +02:00
wm4
4784ca32c9 audio/out: fail init on unknown audio buffer
A 0 audio buffer makes push.c go haywire. Shouldn't normally happen.
2014-09-26 15:50:04 +02:00
wm4
387d5f55e6 ao_sndio: print a warning when draining audio
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.
2014-09-26 15:46:39 +02:00
wm4
da1918b894 ao_sndio: update buffer status on get_delay
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.
2014-09-26 15:46:36 +02:00