From: Anton Khirnov <anton@khirnov.net>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH] lavc/hevcdec: always call hevc_frame_end() after successfully decoding an AU
Date: Wed, 12 Jun 2024 10:14:42 +0200
Message-ID: <20240612081442.24114-1-anton@khirnov.net> (raw)
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>
---
libavcodec/hevc/hevcdec.c | 14 +++++++-------
1 file 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;
}
--
2.43.0
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
reply other threads:[~2024-06-12 8:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240612081442.24114-1-anton@khirnov.net \
--to=anton@khirnov.net \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git