--- a/a52/pcm_a52.c +++ b/a52/pcm_a52.c @@ -1201,7 +1201,20 @@ SND_PCM_PLUGIN_DEFINE_FUNC(a52) #ifdef SND_PCM_IOPLUG_FLAG_BOUNDARY_WA rec->io.flags = SND_PCM_IOPLUG_FLAG_BOUNDARY_WA; #endif -#ifdef USE_AVCODEC_FRAME +#if defined(USE_AVCODEC_FRAME) && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 13, 100) + { + const enum AVSampleFormat *fmts = NULL; + + if (avcodec_get_supported_config(NULL, rec->codec, + AV_CODEC_CONFIG_SAMPLE_FORMAT, 0, + (const void **)&fmts, NULL) < 0 || !fmts) { + err = -EINVAL; + goto error; + } + rec->av_format = fmts[0]; + } + rec->is_planar = av_sample_fmt_is_planar(rec->av_format); +#elif defined(USE_AVCODEC_FRAME) rec->av_format = rec->codec->sample_fmts[0]; rec->is_planar = av_sample_fmt_is_planar(rec->av_format); #else