summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-11-13 00:11:52 -0300
committerJames Almer <jamrial@gmail.com>2017-11-15 01:14:22 -0300
commitd8ea66ab33252a19eaa8ef83bec70e3b4e9e003b (patch)
treeb7a0d40a9ed65fcabb10236a0add6b196fb32249 /libavformat
parent03dae121c0508bddeac30245042485420a0a3370 (diff)
avformat/utils: remove usage of AVCodecContext accessors
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 87887063be..ff5e14df6c 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4028,11 +4028,13 @@ FF_ENABLE_DEPRECATION_WARNINGS
ret = avcodec_parameters_from_context(st->codecpar, st->internal->avctx);
if (ret < 0)
goto find_stream_info_err;
+#if FF_API_LOWRES
// The decoder might reduce the video size by the lowres factor.
- if (av_codec_get_lowres(st->internal->avctx) && orig_w) {
+ if (st->internal->avctx->lowres && orig_w) {
st->codecpar->width = orig_w;
st->codecpar->height = orig_h;
}
+#endif
}
#if FF_API_LAVF_AVCTX
@@ -4041,13 +4043,15 @@ FF_DISABLE_DEPRECATION_WARNINGS
if (ret < 0)
goto find_stream_info_err;
+#if FF_API_LOWRES
// The old API (AVStream.codec) "requires" the resolution to be adjusted
// by the lowres factor.
- if (av_codec_get_lowres(st->internal->avctx) && st->internal->avctx->width) {
- av_codec_set_lowres(st->codec, av_codec_get_lowres(st->internal->avctx));
+ 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;
}
+#endif
if (st->codec->codec_tag != MKTAG('t','m','c','d')) {
st->codec->time_base = st->internal->avctx->time_base;
@@ -4763,10 +4767,10 @@ void avpriv_set_pts_info(AVStream *s, int pts_wrap_bits,
s->time_base = new_tb;
#if FF_API_LAVF_AVCTX
FF_DISABLE_DEPRECATION_WARNINGS
- av_codec_set_pkt_timebase(s->codec, new_tb);
+ s->codec->pkt_timebase = new_tb;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
- av_codec_set_pkt_timebase(s->internal->avctx, new_tb);
+ s->internal->avctx->pkt_timebase = new_tb;
s->pts_wrap_bits = pts_wrap_bits;
}