Commit Graph

17 Commits

Author SHA1 Message Date
Stefano Pigozzi b4e598badf ao_coreaudio: skip unknown channel labels
I don't think this is really a very good idea because it is conceptually
incorrect but other prominent multimedia programs use this approach
(VLC and xbmc), and it seems to make the conversion more robust in certain
cases.

For example it has been reported, that configuring a receiver that can output
7.1 to output 5.1, will make CoreAudio report 8 channel descriptions, and the
last 2 descriptions will be tagged kAudioChannelLabel_Unknown.

Fixes #737
2014-05-10 14:07:45 +02:00
Stefano Pigozzi 39b316ff06 ao_coreaudio: cosmetic change of loop ending condition 2014-05-10 14:07:45 +02:00
Stefano Pigozzi b46ffaec7c ao_coreaudio: use description-based channel layouts
CoreAudio supports 3 kinds of layouts: bitmap based, tag based, and speaker
description based (using either channel labels or positional data).

Previously we tried to convert everything to bitmap based channel layouts,
but it turns out description based ones are the most generic and there are
built-in CoreAudio APIs to perform the conversion in this direction.

Moreover description based layouts support waveext extensions (like SDL and
SDR), and are easier to map to mp_chmaps.
2014-05-10 14:07:45 +02:00
Stefano Pigozzi e2f26f01fe ao_coreaudio: pass layout by reference to logging function
Apparently passing the struct by value somehow messed with the value of some
fields.
2014-05-10 14:07:45 +02:00
Stefano Pigozzi 26ce2e750d ao_coreaudio: log even more info in verbose mode
This logs more info that can be used for debugging purposes, in particular
it prints all the AudioChannelDescription in the descriptions array.
2014-04-24 09:52:38 +02:00
Stefano Pigozzi 2f7cef117a ao_coreaudio: add verbose output of detected channel layouts
This can be useful for debugging purposes.
2014-04-23 23:30:35 +02:00
wm4 eef36f03ea msg: rename mp_msg_log -> mp_msg
Same for companion functions.
2013-12-21 22:13:04 +01:00
Stefano Pigozzi f10cca0e88 ao_coreaudio: simplify ch label to speaker id conversion
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.
2013-11-27 23:15:17 +01:00
Stefano Pigozzi fb508105d1 ao_coreaudio: map channel labels needed for 8ch layouts
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.
2013-11-27 00:51:48 +01:00
Stefano Pigozzi 0bd09da570 ao_coreaudio: move to new log API 2013-08-01 20:32:49 +02:00
Stefano Pigozzi 5cd5f0cf70 ao_coreaudio: remove useless defines
They are already defined in the header file
2013-08-01 20:32:49 +02:00
Stefano Pigozzi 7d58c51fd6 ao_coreaudio: switch properties getters to talloc 2013-07-22 21:53:18 +02:00
Stefano Pigozzi af6ad6717f ao_coreaudio: reduce verbosity of the chmapping code 2013-07-22 21:53:18 +02:00
Stefano Pigozzi c11c744998 ao_coreaudio: refactor chmap detection
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.
2013-07-22 21:53:18 +02:00
Stefano Pigozzi 18777ecfe8 ao_coreaudio: refactor properties code
Introduce some macros to deal with properties. These allow to work around the
limitation of CoreAudio's API being `void **` based. The macros allow to keep
their client's code DRY, by not asking size and other details which can be
derived by the macro itself. I have no idea why Apple didn't design their API
like this in the first place.
2013-07-22 21:53:18 +02:00
Stefano Pigozzi 1ed1175636 ao_coreaudio: move utils functions to snake_case 2013-07-22 21:53:18 +02:00
Stefano Pigozzi 1e37965597 ao_coreaudio: split ao_coreaudio_common in two files
* ao_coreaudio_utils: contains several utility function
 * ao_coreaudio_properties: contains functions to set and get  audio object
   properties.

Conflicts:
	audio/out/ao_coreaudio.c
2013-07-22 21:53:18 +02:00