|
...
|
...
|
@@ -235,24 +235,23 @@ static int config_props(AVFilterLink *link)
|
|
235
|
235
|
}
|
|
236
|
236
|
}
|
|
237
|
237
|
|
|
238
|
|
- /* TODO reindent */
|
|
239
|
|
- // sanity check; can't be done in query_formats since the inlink
|
|
240
|
|
- // channel layout is unknown at that time
|
|
241
|
|
- if (pan->nb_input_channels > SWR_CH_MAX ||
|
|
242
|
|
- pan->nb_output_channels > SWR_CH_MAX) {
|
|
243
|
|
- av_log(ctx, AV_LOG_ERROR,
|
|
244
|
|
- "libswresample support a maximum of %d channels. "
|
|
245
|
|
- "Feel free to ask for a higher limit.\n", SWR_CH_MAX);
|
|
246
|
|
- return AVERROR_PATCHWELCOME;
|
|
247
|
|
- }
|
|
|
238
|
+ // sanity check; can't be done in query_formats since the inlink
|
|
|
239
|
+ // channel layout is unknown at that time
|
|
|
240
|
+ if (pan->nb_input_channels > SWR_CH_MAX ||
|
|
|
241
|
+ pan->nb_output_channels > SWR_CH_MAX) {
|
|
|
242
|
+ av_log(ctx, AV_LOG_ERROR,
|
|
|
243
|
+ "libswresample support a maximum of %d channels. "
|
|
|
244
|
+ "Feel free to ask for a higher limit.\n", SWR_CH_MAX);
|
|
|
245
|
+ return AVERROR_PATCHWELCOME;
|
|
|
246
|
+ }
|
|
248
|
247
|
|
|
249
|
|
- // init libswresample context
|
|
250
|
|
- pan->swr = swr_alloc_set_opts(pan->swr,
|
|
251
|
|
- pan->out_channel_layout, link->format, link->sample_rate,
|
|
252
|
|
- link->channel_layout, link->format, link->sample_rate,
|
|
253
|
|
- 0, ctx);
|
|
254
|
|
- if (!pan->swr)
|
|
255
|
|
- return AVERROR(ENOMEM);
|
|
|
248
|
+ // init libswresample context
|
|
|
249
|
+ pan->swr = swr_alloc_set_opts(pan->swr,
|
|
|
250
|
+ pan->out_channel_layout, link->format, link->sample_rate,
|
|
|
251
|
+ link->channel_layout, link->format, link->sample_rate,
|
|
|
252
|
+ 0, ctx);
|
|
|
253
|
+ if (!pan->swr)
|
|
|
254
|
+ return AVERROR(ENOMEM);
|
|
256
|
255
|
|
|
257
|
256
|
// gains are pure, init the channel mapping
|
|
258
|
257
|
if (pan->pure_gains) {
|
|
...
|
...
|
@@ -365,12 +364,11 @@ static int query_formats(AVFilterContext *ctx)
|
|
365
|
365
|
AVFilterLink *outlink = ctx->outputs[0];
|
|
366
|
366
|
AVFilterFormats *formats;
|
|
367
|
367
|
|
|
368
|
|
- /* TODO reindent */
|
|
369
|
|
- pan->pure_gains = are_gains_pure(pan);
|
|
370
|
|
- /* libswr supports any sample and packing formats */
|
|
371
|
|
- avfilter_set_common_sample_formats(ctx, avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO));
|
|
372
|
|
- avfilter_set_common_packing_formats(ctx, avfilter_make_all_packing_formats());
|
|
373
|
|
- pan->filter_samples = filter_samples_channel_mapping;
|
|
|
368
|
+ pan->pure_gains = are_gains_pure(pan);
|
|
|
369
|
+ /* libswr supports any sample and packing formats */
|
|
|
370
|
+ avfilter_set_common_sample_formats(ctx, avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO));
|
|
|
371
|
+ avfilter_set_common_packing_formats(ctx, avfilter_make_all_packing_formats());
|
|
|
372
|
+ pan->filter_samples = filter_samples_channel_mapping;
|
|
374
|
373
|
|
|
375
|
374
|
// inlink supports any channel layout
|
|
376
|
375
|
formats = avfilter_make_all_channel_layouts();
|