summaryrefslogtreecommitdiffstats
path: root/audio/chmap.c
Commit message (Collapse)AuthorAgeFilesLines
* audio: accept 1.0 and 2.0 as aliases for mono and stereowm42015-02-261-0/+2
|
* chmap_sel: add multichannel fallback heuristicStefano Pigozzi2014-12-291-0/+23
| | | | | | | | | | | | Instead of just failing during channel map selection, try to select a close layout that makes most sense and upmix/downmix to that instead of failing AO initialization. The heuristic is rather simple, and uses the following steps: 1) If mono is required always prefer stereo to a multichannel upmix. 2) Search for an upmix that is an exact superset of the required channel map. 3) Search for a downmix that is the exact subset of the required channel map. 4) Search for either an upmix or downmix that is the closest (minimum difference of channels) to the required channel map.
* chmap: add a 7.1(rear) layout nameStefano Pigozzi2014-12-291-0/+1
| | | | This is common on Apple systems so it's handy to have a label for it.
* audio: make mp_chmap_to_str() return a stack-allocated stringwm42014-11-241-12/+14
| | | | Simplifies memory management.
* options: accept --audio-channels=autowm42014-10-301-0/+1
| | | | This sounds much more intuitive, while "empty" was a bit of a WTF.
* Add more constwm42014-06-111-3/+3
| | | | | | | While I'm not very fond of "const", it's important for declarations (it decides whether a symbol is emitted in a read-only or read/write section). Fix all these cases, so we have writeable global data only when we really need.
* options: fix off-by-1 error in option help outputwm42014-03-151-1/+1
|
* m_option, m_config: mp_msg conversionswm42013-12-211-8/+8
| | | | | | | | Always pass around mp_log contexts in the option parser code. This of course affects all users of this API as well. In stream.c, pass a mp_null_log, because we can't do it properly yet. This will be fixed later.
* Split mpvcore/ into common/, misc/, bstr/wm42013-12-171-1/+1
|
* core: move contents to mpvcore (2/2)Stefano Pigozzi2013-08-061-1/+1
| | | | Followup commit. Fixes all the files references.
* chmap: fix oddity due to ambiguous 6.1 ffmpeg channel layoutwm42013-05-131-2/+3
| | | | | | | | FFmpeg (as well as Libav) have two layouts called "6.1": AV_CH_LAYOUT_6POINT1 and AV_CH_LAYOUT_6POINT1_BACK. We call them "6.1" and "6.1(back)". Change the default layout for 7 channels as well to return the same layout as av_get_default_channel_layout(). (Looks a bit questionable, but for now it's better to follow FFmpeg.)
* audio: fix ALSA 4 channel surround outputwm42013-05-131-1/+3
| | | | | | | | | It turns out that ALSA's 4 channel layout is different from mpv's and ffmpeg's 4.0 layout. Thus trying to do 4 channel output led to incorrect remixing via lib{av,sw}resample. Fix the default layouts for the internal filter chain as well, although I'm not sure if it matters at all.
* audio: add channel map selection functionwm42013-05-121-16/+24
| | | | | | | | | | | | | | | | | | | | The point is selecting a minimal fallback. The AOs will call this through the AO API, so it will be possible to add options affecting the general channel layout selection. It provides the following mechanism to AOs: - forcing the correct channel order - downmixing to stereo if no layout is available - allow 5.1 <-> 5.1(side) fallback - handling "unknown" channel layouts This is quite weak and lots of code/complexity for little gain. All AOs already made sure the channel order was correct, and the fallback is of little value, and could perhaps be done in the frontend instead, like stereo downmixing with --channels=2 is handled. But I'm not really sure how this stuff should _really_ work, and the new code will hopefully provides enough flexibility to make radical changes to channel layout negotiation easier.
* audio: add channel map APIwm42013-05-121-0/+478
Unused, will be used in the following commits. Let chmap.h define the number of maximum channels, because that is most convenient.