From 03b3fcecac41566aadb99281cff3444d903820b8 Mon Sep 17 00:00:00 2001 From: Attila Nagy Date: Tue, 31 Jul 2012 14:04:45 +0300 Subject: Fix potential encoder dead-lock after picture resize The sync interval for the multithreaded encoder was considered as not changing during the encoding. This is not true if picture size is changed. The encoder could dead-lock because the main thread and the other threads were using different sync interval. Change-Id: I75232bbdbc6c02d77f830d870fd8b4e96697c64e --- vp8/encoder/ethreading.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'vp8') diff --git a/vp8/encoder/ethreading.c b/vp8/encoder/ethreading.c index 919bc70a0..e0bb1b09f 100644 --- a/vp8/encoder/ethreading.c +++ b/vp8/encoder/ethreading.c @@ -59,8 +59,6 @@ THREAD_FUNCTION thread_encoding_proc(void *p_data) MB_ROW_COMP *mbri = (MB_ROW_COMP *)(((ENCODETHREAD_DATA *)p_data)->ptr2); ENTROPY_CONTEXT_PLANES mb_row_left_context; - const int nsync = cpi->mt_sync_range; - while (1) { if (cpi->b_multi_threaded == 0) @@ -68,6 +66,7 @@ THREAD_FUNCTION thread_encoding_proc(void *p_data) if (sem_wait(&cpi->h_event_start_encoding[ithread]) == 0) { + const int nsync = cpi->mt_sync_range; VP8_COMMON *cm = &cpi->common; int mb_row; MACROBLOCK *x = &mbri->mb; -- cgit v1.2.3