-int ifilter_parameters_from_decoder(InputFilter *ifilter, const AVCodecContext *avctx)
-{
- av_buffer_unref(&ifilter->hw_frames_ctx);
-
- if (avctx->codec_type == AVMEDIA_TYPE_VIDEO)
- ifilter->format = avctx->pix_fmt;
- else
- ifilter->format = avctx->sample_fmt;
-
- ifilter->width = avctx->width;
- ifilter->height = avctx->height;
- ifilter->sample_aspect_ratio = avctx->sample_aspect_ratio;
-
- ifilter->sample_rate = avctx->sample_rate;
- ifilter->channel_layout = avctx->channel_layout;
-
- if (avctx->hw_frames_ctx) {
- ifilter->hw_frames_ctx = av_buffer_ref(avctx->hw_frames_ctx);
- if (!ifilter->hw_frames_ctx)
- return AVERROR(ENOMEM);
- }
-
- return 0;
-}
-