-#if FF_API_LAVF_AVCTX
-FF_DISABLE_DEPRECATION_WARNINGS
- ret = avcodec_parameters_to_context(st->codec, st->codecpar);
- if (ret < 0)
- goto find_stream_info_err;
-
- // The old API (AVStream.codec) "requires" the resolution to be adjusted
- // by the lowres factor.
- if (st->internal->avctx->lowres && st->internal->avctx->width) {
- st->codec->lowres = st->internal->avctx->lowres;
- st->codec->width = st->internal->avctx->width;
- st->codec->height = st->internal->avctx->height;
- }
-
- if (st->codec->codec_tag != MKTAG('t','m','c','d')) {
- st->codec->time_base = st->internal->avctx->time_base;
- st->codec->ticks_per_frame = st->internal->avctx->ticks_per_frame;
- }
- st->codec->framerate = st->avg_frame_rate;
-
- if (st->internal->avctx->subtitle_header) {
- st->codec->subtitle_header = av_malloc(st->internal->avctx->subtitle_header_size);
- if (!st->codec->subtitle_header)
- goto find_stream_info_err;
- st->codec->subtitle_header_size = st->internal->avctx->subtitle_header_size;
- memcpy(st->codec->subtitle_header, st->internal->avctx->subtitle_header,
- st->codec->subtitle_header_size);
- }
-
- // Fields unavailable in AVCodecParameters
- st->codec->coded_width = st->internal->avctx->coded_width;
- st->codec->coded_height = st->internal->avctx->coded_height;
- st->codec->properties = st->internal->avctx->properties;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-