aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2024-06-12 10:08:02 +0200
committerAnton Khirnov <anton@khirnov.net>2024-06-13 11:44:05 +0200
commit0060a368b175b1cbc01800af2d3d17ca9f88970c (patch)
treecaa4d7478d3ddd210e70fce5bc87c6335fa28732
parent959cb2e2e36cad50b88d45c1201c2c3d64d4e48c (diff)
downloadffmpeg-0060a368b175b1cbc01800af2d3d17ca9f88970c.tar.gz
lavc/hevcdec: always call hevc_frame_end() after successfully decoding an AU
Currently it is only done if the final CTB address is at the end of the frame, however that address is not known with hwaccel decoding. As we only support exactly one AU per packet, and not partial/multiple AUs, we can just as well call hevc_frame_end() unconditionally. Fixes hwaccel decoding after d725c737fe2a19091b481d4d115fd939e0a674b2. Reported-by: llyyr <llyyr.public@gmail.com>
-rw-r--r--libavcodec/hevc/hevcdec.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index 88f2bcecad..4b95358b95 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -3192,11 +3192,6 @@ static int decode_slice(HEVCContext *s, const H2645NAL *nal, GetBitContext *gb)
ret = decode_slice_data(s, nal, gb);
if (ret < 0)
return ret;
- if (ret >= s->cur_frame->ctb_count) {
- ret = hevc_frame_end(s);
- if (ret < 0)
- return ret;
- }
return 0;
}
@@ -3370,8 +3365,13 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length)
}
fail:
- if (s->cur_frame && s->avctx->active_thread_type == FF_THREAD_FRAME)
- ff_progress_frame_report(&s->cur_frame->tf, INT_MAX);
+ if (s->cur_frame) {
+ if (ret >= 0)
+ ret = hevc_frame_end(s);
+
+ if (s->avctx->active_thread_type == FF_THREAD_FRAME)
+ ff_progress_frame_report(&s->cur_frame->tf, INT_MAX);
+ }
return ret;
}