1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

Merge commit '949c603ed9210df0e1b8e1aa82c71b93543d8071'

* commit '949c603ed9210df0e1b8e1aa82c71b93543d8071':
  af_channelmap: remove now unnecessary goto
  vf_split: fix description

Conflicts:
	libavfilter/split.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-05-01 10:11:01 +02:00
commit a1b8879714
2 changed files with 12 additions and 25 deletions

View File

@ -123,7 +123,6 @@ static int get_channel(char **map, uint64_t *ch, char delim)
static av_cold int channelmap_init(AVFilterContext *ctx)
{
ChannelMapContext *s = ctx->priv;
int ret = 0;
char *mapping, separator = '|';
int map_entries = 0;
char buf[256];
@ -173,8 +172,7 @@ static av_cold int channelmap_init(AVFilterContext *ctx)
if (map_entries > MAX_CH) {
av_log(ctx, AV_LOG_ERROR, "Too many channels mapped: '%d'.\n", map_entries);
ret = AVERROR(EINVAL);
goto fail;
return AVERROR(EINVAL);
}
for (i = 0; i < map_entries; i++) {
@ -184,9 +182,8 @@ static av_cold int channelmap_init(AVFilterContext *ctx)
switch (mode) {
case MAP_ONE_INT:
if (get_channel_idx(&mapping, &in_ch_idx, separator, MAX_CH) < 0) {
ret = AVERROR(EINVAL);
av_log(ctx, AV_LOG_ERROR, err);
goto fail;
return AVERROR(EINVAL);
}
s->map[i].in_channel_idx = in_ch_idx;
s->map[i].out_channel_idx = i;
@ -194,8 +191,7 @@ static av_cold int channelmap_init(AVFilterContext *ctx)
case MAP_ONE_STR:
if (!get_channel(&mapping, &in_ch, separator)) {
av_log(ctx, AV_LOG_ERROR, err);
ret = AVERROR(EINVAL);
goto fail;
return AVERROR(EINVAL);
}
s->map[i].in_channel = in_ch;
s->map[i].out_channel_idx = i;
@ -204,8 +200,7 @@ static av_cold int channelmap_init(AVFilterContext *ctx)
if (get_channel_idx(&mapping, &in_ch_idx, '-', MAX_CH) < 0 ||
get_channel_idx(&mapping, &out_ch_idx, separator, MAX_CH) < 0) {
av_log(ctx, AV_LOG_ERROR, err);
ret = AVERROR(EINVAL);
goto fail;
return AVERROR(EINVAL);
}
s->map[i].in_channel_idx = in_ch_idx;
s->map[i].out_channel_idx = out_ch_idx;
@ -215,8 +210,7 @@ static av_cold int channelmap_init(AVFilterContext *ctx)
get_channel(&mapping, &out_ch, separator) < 0 ||
out_ch & out_ch_mask) {
av_log(ctx, AV_LOG_ERROR, err);
ret = AVERROR(EINVAL);
goto fail;
return AVERROR(EINVAL);
}
s->map[i].in_channel_idx = in_ch_idx;
s->map[i].out_channel = out_ch;
@ -226,8 +220,7 @@ static av_cold int channelmap_init(AVFilterContext *ctx)
if (get_channel(&mapping, &in_ch, '-') < 0 ||
get_channel_idx(&mapping, &out_ch_idx, separator, MAX_CH) < 0) {
av_log(ctx, AV_LOG_ERROR, err);
ret = AVERROR(EINVAL);
goto fail;
return AVERROR(EINVAL);
}
s->map[i].in_channel = in_ch;
s->map[i].out_channel_idx = out_ch_idx;
@ -237,8 +230,7 @@ static av_cold int channelmap_init(AVFilterContext *ctx)
get_channel(&mapping, &out_ch, separator) < 0 ||
out_ch & out_ch_mask) {
av_log(ctx, AV_LOG_ERROR, err);
ret = AVERROR(EINVAL);
goto fail;
return AVERROR(EINVAL);
}
s->map[i].in_channel = in_ch;
s->map[i].out_channel = out_ch;
@ -256,8 +248,7 @@ static av_cold int channelmap_init(AVFilterContext *ctx)
if ((fmt = av_get_channel_layout(s->channel_layout_str)) == 0) {
av_log(ctx, AV_LOG_ERROR, "Error parsing channel layout: '%s'.\n",
s->channel_layout_str);
ret = AVERROR(EINVAL);
goto fail;
return AVERROR(EINVAL);
}
if (mode == MAP_NONE) {
int i;
@ -271,14 +262,12 @@ static av_cold int channelmap_init(AVFilterContext *ctx)
av_log(ctx, AV_LOG_ERROR,
"Output channel layout '%s' does not match the list of channel mapped: '%s'.\n",
s->channel_layout_str, buf);
ret = AVERROR(EINVAL);
goto fail;
return AVERROR(EINVAL);
} else if (s->nch != av_get_channel_layout_nb_channels(fmt)) {
av_log(ctx, AV_LOG_ERROR,
"Output channel layout %s does not match the number of channels mapped %d.\n",
s->channel_layout_str, s->nch);
ret = AVERROR(EINVAL);
goto fail;
return AVERROR(EINVAL);
}
s->output_layout = fmt;
}
@ -291,9 +280,7 @@ static av_cold int channelmap_init(AVFilterContext *ctx)
}
}
fail:
av_opt_free(s);
return ret;
return 0;
}
static int channelmap_query_formats(AVFilterContext *ctx)

View File

@ -115,7 +115,7 @@ static const AVFilterPad avfilter_vf_split_inputs[] = {
AVFilter avfilter_vf_split = {
.name = "split",
.description = NULL_IF_CONFIG_SMALL("Pass on the input video to N outputs."),
.description = NULL_IF_CONFIG_SMALL("Pass on the input to N video outputs."),
.priv_size = sizeof(SplitContext),
.priv_class = &split_class,