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

From decode_nal_unit(), as that is a more appropriate place for it.
This commit is contained in:
Anton Khirnov 2024-06-02 14:02:52 +02:00
parent 3bbb5d78c7
commit 6ee550d83d
1 changed files with 5 additions and 7 deletions

View File

@ -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)