avfilter/asrc_aevalsrc: fix cases of unknown channel layout
Fixes >8 channels Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
		@@ -125,7 +125,7 @@ static int init(AVFilterContext *ctx)
 | 
				
			|||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
        /* guess channel layout from nb expressions/channels */
 | 
					        /* guess channel layout from nb expressions/channels */
 | 
				
			||||||
        eval->chlayout = av_get_default_channel_layout(eval->nb_channels);
 | 
					        eval->chlayout = av_get_default_channel_layout(eval->nb_channels);
 | 
				
			||||||
        if (!eval->chlayout) {
 | 
					        if (!eval->chlayout && eval->nb_channels <= 0) {
 | 
				
			||||||
            av_log(ctx, AV_LOG_ERROR, "Invalid number of channels '%d' provided\n",
 | 
					            av_log(ctx, AV_LOG_ERROR, "Invalid number of channels '%d' provided\n",
 | 
				
			||||||
                   eval->nb_channels);
 | 
					                   eval->nb_channels);
 | 
				
			||||||
            ret = AVERROR(EINVAL);
 | 
					            ret = AVERROR(EINVAL);
 | 
				
			||||||
@@ -177,7 +177,7 @@ static int query_formats(AVFilterContext *ctx)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    EvalContext *eval = ctx->priv;
 | 
					    EvalContext *eval = ctx->priv;
 | 
				
			||||||
    static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE };
 | 
					    static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE };
 | 
				
			||||||
    int64_t chlayouts[] = { eval->chlayout, -1 };
 | 
					    int64_t chlayouts[] = { eval->chlayout ? eval->chlayout : FF_COUNT2LAYOUT(eval->nb_channels) , -1 };
 | 
				
			||||||
    int sample_rates[] = { eval->sample_rate, -1 };
 | 
					    int sample_rates[] = { eval->sample_rate, -1 };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ff_set_common_formats (ctx, ff_make_format_list(sample_fmts));
 | 
					    ff_set_common_formats (ctx, ff_make_format_list(sample_fmts));
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user