On Thu, Jun 21, 2012 at 04:15:13PM -0700, Alex Converse wrote:
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -232,6 +232,39 @@ front_center.wav -map '[LFE]' lfe.wav -map '[SL]'
> side_left.wav -map '[SR]'
>
> +@section channelmap
> +Remap input channels to new locations.
> +
> +This filter accepts the following named parameters:
> +@table @option
> +@item channel_layout
> +Channel layout of the output stream.
How do I specify channel layouts?
> +@item map
> +Map channels from input to output. The argument is a comma-separated list of
> +mappings, each in the @code{@var{in_channel}-@var{out_channel}} or
> +@var{in_channel} form. @var{in_channel} can be either the name of the input
> +channel (e.g. FR for front left) or its index in the input channel layout.
FR is front left?
> +@var{out_channel} is the name of the output channel or its index in the
> output
> +channel layout. If out channel is not given then it is implicitly an index,
Mark "out channel" as @var{out_channel}, so it's clear you mean the
same thing.
> +will create an output Wave file tagged as stereo from the downmix channels of
WAVE
> +To fix a 5.1 wav improperly encoded in AAC's native channel order
WAV
> --- /dev/null
> +++ b/libavfilter/af_channelmap.c
> @@ -0,0 +1,410 @@
> +static char* split(char *message, char delim) {
{ on the next line
> + char *next = strchr(message, delim);
> + if (next) {
> + *next++ = '\0';
> + }
drop {}
> +static int get_channel_idx(char **map, int *ch, char delim, int max_ch) {
{ on the next line
> +static int get_channel(char **map, uint64_t *ch, char delim) {
{ on the next line
> + s->map[i].in_channel_idx = in_ch_idx;
> + s->map[i].out_channel_idx = i;
> + break;
> + s->map[i].in_channel = in_ch;
> + s->map[i].out_channel_idx = i;
> + break;
> + s->map[i].in_channel_idx = in_ch_idx;
> + s->map[i].out_channel_idx = out_ch_idx;
> + break;
> + s->map[i].in_channel_idx = in_ch_idx;
> + s->map[i].out_channel = out_ch;
> + out_ch_mask |= out_ch;
> + break;
> + s->map[i].in_channel = in_ch;
> + s->map[i].out_channel_idx = out_ch_idx;
> + break;
> + s->map[i].in_channel = in_ch;
> + s->map[i].out_channel = out_ch;
> + out_ch_mask |= out_ch;
> + break;
align the =
> + s->mode = mode;
> + s->nch = map_entries;
> + s->output_layout = out_ch_mask ? out_ch_mask :
> + av_get_default_channel_layout(map_entries);
align the =
Align the continuing line with the rhs of the assignment, not just
four spaces.
> + for (i = 0; i < s->nch; i++) {
> + s->map[i].in_channel_idx = i;
> + s->map[i].out_channel_idx = i;
align the =
> + if (mode == MAP_PAIR_INT_STR || mode == MAP_PAIR_STR_STR) {
> + for (i = 0; i < s->nch; i++) {
> + s->map[i].out_channel_idx = av_get_channel_layout_channel_index(
> + s->output_layout, s->map[i].out_channel);
> + }
> + }
drop some {}
Breaking lines after an opening parenthesis is ugly; better move the whole
function invocation to the next line if you are worried about line length.
> + const int nch_in = FFMIN(
> + av_get_channel_layout_nb_channels(inlink->channel_layout), MAX_CH);
same
> + for (ch = 0; ch < nch_out; ch++) {
> + buf->extended_data[s->map[ch].out_channel_idx] =
> + source_planes[s->map[ch].in_channel_idx];
> + }
drop {}
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel