[FFmpeg-cvslog] lavc/hevcdec: move calling hwaccel start_frame to hevc_frame_start()

Anton Khirnov git at videolan.org
Tue Jun 11 18:51:21 EEST 2024


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sun Jun  2 14:02:52 2024 +0200| [6ee550d83d155225c3f57b49b22a992c9d4e59f8] | committer: Anton Khirnov

lavc/hevcdec: move calling hwaccel start_frame to hevc_frame_start()

>From decode_nal_unit(), as that is a more appropriate place for it.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6ee550d83d155225c3f57b49b22a992c9d4e59f8
---

 libavcodec/hevc/hevcdec.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index cda52e05ef..0bf68ea45c 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -3006,7 +3006,11 @@ static int hevc_frame_start(HEVCContext *s)
     if (ret < 0)
         goto fail;
 
-    if (!s->avctx->hwaccel)
+    if (s->avctx->hwaccel) {
+        ret = FF_HW_CALL(s->avctx, start_frame, NULL, 0);
+        if (ret < 0)
+            goto fail;
+    } else
         ff_thread_finish_setup(s->avctx);
 
     return 0;
@@ -3148,12 +3152,6 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal)
             }
         }
 
-        if (s->sh.first_slice_in_pic_flag && s->avctx->hwaccel) {
-            ret = FF_HW_CALL(s->avctx, start_frame, NULL, 0);
-            if (ret < 0)
-                goto fail;
-        }
-
         if (s->avctx->hwaccel) {
             ret = FF_HW_CALL(s->avctx, decode_slice, nal->raw_data, nal->raw_size);
             if (ret < 0)



More information about the ffmpeg-cvslog mailing list