This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 183c14e20e8049b34f140bd0f5b4a7e3b24433e8 Author: Niklas Haas <[email protected]> AuthorDate: Tue Jul 28 15:47:28 2026 +0200 Commit: Niklas Haas <[email protected]> CommitDate: Fri Aug 14 10:41:40 2026 +0200 swscale: simplify slice_ctx error propagation Signed-off-by: Niklas Haas <[email protected]> --- libswscale/swscale.c | 21 +++++---------------- libswscale/swscale_internal.h | 1 - libswscale/utils.c | 4 +--- 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index ad0ccf63d0..bdaf17d9b1 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -1383,26 +1383,13 @@ int sws_receive_slice(SwsContext *sws, unsigned int slice_start, if (c->slicethread) { int nb_jobs = c->nb_slice_ctx; - int ret = 0; - if (c->slice_ctx[0]->dither == SWS_DITHER_ED) nb_jobs = 1; c->dst_slice_start = slice_start; c->dst_slice_height = slice_height; - avpriv_slicethread_execute2(c->slicethread, nb_jobs, 0); - - for (int i = 0; i < c->nb_slice_ctx; i++) { - if (c->slice_err[i] < 0) { - ret = c->slice_err[i]; - break; - } - } - - memset(c->slice_err, 0, c->nb_slice_ctx * sizeof(*c->slice_err)); - - return ret; + return avpriv_slicethread_execute2(c->slicethread, nb_jobs, 0); } for (int i = 0; i < FF_ARRAY_ELEMS(dst); i++) { @@ -1685,6 +1672,8 @@ int ff_sws_slice_worker(void *priv, int jobnr, int threadnr, parent->dst_slice_start + slice_start, slice_end - slice_start); } - parent->slice_err[threadnr] = err; - return 0; + if (err < 0) + return err; + + return 0; /* ff_slicethread_execute() aborts on non-zero */ } diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index e7f7f6be53..a1fa50dad0 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -343,7 +343,6 @@ struct SwsInternal { AVSliceThread *slicethread; SwsContext **slice_ctx; - int *slice_err; int nb_slice_ctx; /* Scaling graph, reinitialized dynamically as needed. */ diff --git a/libswscale/utils.c b/libswscale/utils.c index 98baa6e73b..f5a992388b 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -1851,8 +1851,7 @@ static int context_init_threaded(SwsContext *sws, sws->threads = ret; c->slice_ctx = av_calloc(sws->threads, sizeof(*c->slice_ctx)); - c->slice_err = av_calloc(sws->threads, sizeof(*c->slice_err)); - if (!c->slice_ctx || !c->slice_err) + if (!c->slice_ctx) return AVERROR(ENOMEM); for (int i = 0; i < sws->threads; i++) { @@ -2264,7 +2263,6 @@ void sws_freeContext(SwsContext *sws) for (i = 0; i < c->nb_slice_ctx; i++) sws_freeContext(c->slice_ctx[i]); av_freep(&c->slice_ctx); - av_freep(&c->slice_err); avpriv_slicethread_free(&c->slicethread); _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
