aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/audioconvert.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-09-11 23:35:35 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-12 00:32:54 +0200
commit411cc5c46a89ce0a79832c37d0eab1ed884e5423 (patch)
tree0217179f24cd9629b568b521b1c749e51d6ea7c9 /libavutil/audioconvert.c
parent5a6f4a130226e04e0db3bd7c7c1ff76fe3f06080 (diff)
parent6cfed1127005e9d79e03b4b04fd75124a291d3db (diff)
downloadffmpeg-411cc5c46a89ce0a79832c37d0eab1ed884e5423.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: (31 commits) audioconvert: add explanatory comments to channel_names array audioconvert: K&R whitespace cosmetics avconv: use correct index when selecting metadata to write to. avconv: fix inverted variable doc/avconv: document option types (input/output/per-stream/...) doc/avtools-common-opts: write a section about stream specifiers. doc/avconv: remove two pointless paragraphs. doc/avconv: document that global options should be specified first. doc/avconv: remove entries for nonexistent options doc/avconv: remove documentation for removed 'timestamp' option doc: cosmetics, rename fftools-common-opts to avtools-.... avconv: move streamid_map to options context. avconv: extend -vf syntax avconv: move top_field_first to options context. avconv: move inter/intra matrix to options context. avconv: remove -psnr option. avconv: remove me_threshold option. avconv: move video_rc_override_string to options context. avconv: move frame pixel format to the options context. avconv: move frame aspect ratio to the options context. ... Conflicts: avconv.c cmdutils_common_opts.h doc/avconv.texi Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/audioconvert.c')
-rw-r--r--libavutil/audioconvert.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/libavutil/audioconvert.c b/libavutil/audioconvert.c
index 61dd6f3ccc..524f6f9e9e 100644
--- a/libavutil/audioconvert.c
+++ b/libavutil/audioconvert.c
@@ -28,11 +28,26 @@
#include "audioconvert.h"
static const char * const channel_names[] = {
- "FL", "FR", "FC", "LFE", "BL", "BR", "FLC", "FRC",
- "BC", "SL", "SR", "TC", "TFL", "TFC", "TFR", "TBL",
- "TBC", "TBR",
- [29] = "DL",
- [30] = "DR",
+ [0] = "FL", /* front left */
+ [1] = "FR", /* front right */
+ [2] = "FC", /* front center */
+ [3] = "LFE", /* low frequency */
+ [4] = "BL", /* back left */
+ [5] = "BR", /* back right */
+ [6] = "FLC", /* front left-of-center */
+ [7] = "FRC", /* front right-of-center */
+ [8] = "BC", /* back-center */
+ [9] = "SL", /* side left */
+ [10] = "SR", /* side right */
+ [11] = "TC", /* top center */
+ [12] = "TFL", /* top front left */
+ [13] = "TFC", /* top front center */
+ [14] = "TFR", /* top front right */
+ [15] = "TBL", /* top back left */
+ [16] = "TBC", /* top back center */
+ [17] = "TBR", /* top back right */
+ [29] = "DL", /* downmix left */
+ [30] = "DR", /* downmix right */
};
static const char *get_channel_name(int channel_id)
@@ -91,13 +106,14 @@ void av_get_channel_layout_string(char *buf, int buf_size,
snprintf(buf, buf_size, "%d channels", nb_channels);
if (channel_layout) {
- int i,ch;
+ int i, ch;
av_strlcat(buf, " (", buf_size);
- for(i=0,ch=0; i<64; i++) {
- if ((channel_layout & (1L<<i))) {
+ for (i = 0, ch = 0; i < 64; i++) {
+ if ((channel_layout & (1L << i))) {
const char *name = get_channel_name(i);
if (name) {
- if (ch>0) av_strlcat(buf, "|", buf_size);
+ if (ch > 0)
+ av_strlcat(buf, "|", buf_size);
av_strlcat(buf, name, buf_size);
}
ch++;