aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/av1dec.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2020-09-25 11:20:41 -0300
committerJames Almer <jamrial@gmail.com>2020-09-29 21:38:27 -0300
commitea4b10249d1a9211fb050961d99aeb1725f4f783 (patch)
tree4e4db9d465f20668af4dff7c0ecb8e44f6df1352 /libavcodec/av1dec.c
parent421906dddb631420fe82c6248f14100bae19b8b8 (diff)
downloadffmpeg-ea4b10249d1a9211fb050961d99aeb1725f4f783.tar.gz
avcodec/av1dec: parse dimensions from the sequence header in extradata
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/av1dec.c')
-rw-r--r--libavcodec/av1dec.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
index 0bb04a3e44..f6b9fbbac3 100644
--- a/libavcodec/av1dec.c
+++ b/libavcodec/av1dec.c
@@ -405,6 +405,9 @@ static av_cold int av1_decode_free(AVCodecContext *avctx)
static int set_context_with_sequence(AVCodecContext *avctx,
const AV1RawSequenceHeader *seq)
{
+ int width = seq->max_frame_width_minus_1 + 1;
+ int height = seq->max_frame_height_minus_1 + 1;
+
avctx->profile = seq->seq_profile;
avctx->level = seq->seq_level_idx[0];
@@ -423,6 +426,13 @@ static int set_context_with_sequence(AVCodecContext *avctx,
break;
}
+ if (avctx->width != width || avctx->height != height) {
+ int ret = ff_set_dimensions(avctx, width, height);
+ if (ret < 0)
+ return ret;
+ }
+ avctx->sample_aspect_ratio = (AVRational) { 1, 1 };
+
if (seq->timing_info.num_units_in_display_tick &&
seq->timing_info.time_scale) {
av_reduce(&avctx->framerate.den, &avctx->framerate.num,