You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	lavc/pthread_frame: set worker thread names
This commit is contained in:
		| @@ -179,6 +179,17 @@ static void async_unlock(FrameThreadContext *fctx) | ||||
|     pthread_mutex_unlock(&fctx->async_mutex); | ||||
| } | ||||
|  | ||||
| static void thread_set_name(PerThreadContext *p) | ||||
| { | ||||
|     AVCodecContext *avctx = p->avctx; | ||||
|     int idx = p - p->parent->threads; | ||||
|     char name[16]; | ||||
|  | ||||
|     snprintf(name, sizeof(name), "av:%.7s:df%d", avctx->codec->name, idx); | ||||
|  | ||||
|     ff_thread_setname(name); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Codec worker thread. | ||||
|  * | ||||
| @@ -192,6 +203,8 @@ static attribute_align_arg void *frame_worker_thread(void *arg) | ||||
|     AVCodecContext *avctx = p->avctx; | ||||
|     const FFCodec *codec = ffcodec(avctx->codec); | ||||
|  | ||||
|     thread_set_name(p); | ||||
|  | ||||
|     pthread_mutex_lock(&p->mutex); | ||||
|     while (1) { | ||||
|         while (atomic_load(&p->state) == STATE_INPUT_READY && !p->die) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user