[FFmpeg-devel] [PATCH 2/4] lavc/pthread_frame: set worker thread names

Henrik Gramner henrik at gramner.com
Tue Oct 18 23:59:21 EEST 2022


On Tue, Oct 18, 2022 at 6:54 PM Anton Khirnov <anton at khirnov.net> wrote:
> +static void thread_set_name(PerThreadContext *p)
> +{
> +    AVCodecContext *avctx = p->avctx;
> +    int idx = p - p->parent->threads;
> +    char name[16];
> +
> +    snprintf(name, sizeof(name), "d:%.7s:ft%d", avctx->codec->name, idx);
> +
> +    ff_thread_setname(name);
> +}

How about having some kind of prefix to indicate that those are
libavcodec threads?

Could be helpful in a scenario where a process has threads spawned by
35 different libraries.


More information about the ffmpeg-devel mailing list