mirror of
				https://github.com/nyanmisaka/ffmpeg-rockchip.git
				synced 2025-10-31 12:36:41 +08:00 
			
		
		
		
	threads: move state update after progress cleanup.
This order is more logic and might prevent a race. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
		| @@ -386,14 +386,14 @@ static attribute_align_arg void *frame_worker_thread(void *arg) | |||||||
|  |  | ||||||
|         if (p->state == STATE_SETTING_UP) ff_thread_finish_setup(avctx); |         if (p->state == STATE_SETTING_UP) ff_thread_finish_setup(avctx); | ||||||
|  |  | ||||||
|         p->state = STATE_INPUT_READY; |  | ||||||
|  |  | ||||||
|         pthread_mutex_lock(&p->progress_mutex); |         pthread_mutex_lock(&p->progress_mutex); | ||||||
|         for (i = 0; i < MAX_BUFFERS; i++) |         for (i = 0; i < MAX_BUFFERS; i++) | ||||||
|             if (p->progress_used[i]) { |             if (p->progress_used[i]) { | ||||||
|                 p->progress[i][0] = INT_MAX; |                 p->progress[i][0] = INT_MAX; | ||||||
|                 p->progress[i][1] = INT_MAX; |                 p->progress[i][1] = INT_MAX; | ||||||
|             } |             } | ||||||
|  |         p->state = STATE_INPUT_READY; | ||||||
|  |  | ||||||
|         pthread_cond_broadcast(&p->progress_cond); |         pthread_cond_broadcast(&p->progress_cond); | ||||||
|         pthread_cond_signal(&p->output_cond); |         pthread_cond_signal(&p->output_cond); | ||||||
|         pthread_mutex_unlock(&p->progress_mutex); |         pthread_mutex_unlock(&p->progress_mutex); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Michael Niedermayer
					Michael Niedermayer