Commit Graph

14 Commits

Author SHA1 Message Date
wm4 0ae0e90eb5 ao_coreaudio_exclusive: check new format before waiting for change
It seems if the format was already set, setting the same format will
not cause a property change.
2015-05-06 21:48:39 +02:00
wm4 4444ff48fa ao_coreaudio_exclusive: use atomics instead of volatile
volatile barely means anything.

The polling is kind of bad too, but relatively harmless as device
opening/closing is a rare event, and the format change is not expected
to take long.

Remove the pointless talloc call too (must have been a leftover
from previous refactoring).
2015-05-06 21:48:36 +02:00
wm4 028739932b ao_coreaudio_exclusive: rename "digital" -> "compressed"
PCM is digital too.
2015-05-06 18:54:53 +02:00
wm4 1e1045b13e ao_coreaudio_exclusive: explicitly check for spdif formats 2015-05-06 18:51:31 +02:00
wm4 32bc61ae07 ao_coreaudio_exclusive: merge init_digital() function
No reason to keep them separate. It's an artifact from the old
ao_coreaudio.c, which kept usage of two different APIs in the same file.
Removes a forward reference too.
2015-05-06 18:46:51 +02:00
wm4 bbedceb467 ao_coreaudio_exclusive: fix latency calculation non-sense
Didn't use the properties it was supposed to use.
2015-05-05 21:46:39 +02:00
wm4 382434d45a ao_coreaudio_exclusive: check format explicitly on change notifcation
This should for now be equivalent; it's merely more explicit and will
be required if we add PCM support.

Note that the property listeners actually tell you what property
exactly changed, but resolving the current listener mess would be too
hard. So check for changes manually.
2015-04-29 23:10:45 +02:00
wm4 8b4ca58062 ao_coreaudio_exclusive: move code for getting original format
Should be almost equivalent, unless there are streams on which this call
does not work for unknown reasons.
2015-04-28 22:11:43 +02:00
wm4 5f86fad2f0 ao_coreaudio_exclusive: account for additional latency
Whether this is correct is unknown. This change tripples the latency
from ~15ms to ~45ms.

XBMC does this, VLC does not from what I could see.
2015-04-28 22:09:51 +02:00
Marcin Kurczewski f43017bfe9 Update license headers
Signed-off-by: wm4 <wm4@nowhere>
2015-04-13 12:10:01 +02:00
wm4 2f5e31cf47 ao_coreaudio_exclusive: port to pull API, fix latency calculations
Instead of maintaining a private ring buffer, use the generic support
for audio APIs with pull callbacks (internally called AO pull API). This
also fixes latency calculations: instead of just returning the
ringbuffer status, the audio playback state is calculated better and
includes interpolation.

The main reason this wasn't done earlier was mid-stream format
switching. The pull API can now handle it (in a way) by destroying and
recreating the AO. This is a bit brutal, but quite simple. It's untested
in this new AO, though. Some details might not be right, like how ot
restores the old format when reloading.
2015-03-10 10:37:05 +01:00
wm4 ee14da2988 ao_coreaudio_exclusive: rip out pseudo volume control
This could mute a digital passthrough stream by writing zeros. All other
volume values did nothing.

The comment about MPlayer dying hasn't been true in mpv for quite a
while. It's even possible that it's fixed in upstream MPlayer. mpv will
print a scary error message when trying to change volume with spdif, and
continue normally.

If we really want to mute by writing zeros, we should do it in a
separate filter. But I'm not overly fascinated by this approach; is it
even guaranteed receivers will not be confused by a stream of zeros?

The main reason to remove this is that it's in the way of further
cleanups.
2015-03-10 10:08:15 +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
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