[FFmpeg-devel] [PATCH] Make execute() and execute2() return FFMIN() of thread return codes

Anton Khirnov anton at khirnov.net
Sat Jul 2 12:43:26 EEST 2022


Quoting Tomas Härdin (2022-06-30 14:42:42)
> Hi
> 
> Previous version of this patch failed fate-fic-avi with
> THREAD_TYPE=slice THREADS=2 due to thread_execute() always returning 0.
> Fixed in this version.
> 
> The fic sample appears to indeed be broken. Some packets are truncated,
> including one zero-length packet.

maybe mention this fact for posterity above the relevant test in
tests/fate/scren.mak

> diff --git a/libavutil/slicethread.h b/libavutil/slicethread.h
> index f6f6f302c4..5c8f197932 100644
> --- a/libavutil/slicethread.h
> +++ b/libavutil/slicethread.h
> @@ -31,8 +31,8 @@ typedef struct AVSliceThread AVSliceThread;
>   * @return return number of threads or negative AVERROR on failure
>   */
>  int avpriv_slicethread_create(AVSliceThread **pctx, void *priv,
> -                              void (*worker_func)(void *priv, int jobnr, int threadnr, int nb_jobs, int nb_threads),
> -                              void (*main_func)(void *priv),
> +                              int (*worker_func)(void *priv, int jobnr, int threadnr, int nb_jobs, int nb_threads),
> +                              int (*main_func)(void *priv),

This is an ABI break.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list