Commit 03b3fcec authored by Attila Nagy's avatar Attila Nagy
Browse files

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
Showing with 1 addition and 2 deletions
...@@ -59,8 +59,6 @@ THREAD_FUNCTION thread_encoding_proc(void *p_data) ...@@ -59,8 +59,6 @@ THREAD_FUNCTION thread_encoding_proc(void *p_data)
MB_ROW_COMP *mbri = (MB_ROW_COMP *)(((ENCODETHREAD_DATA *)p_data)->ptr2); MB_ROW_COMP *mbri = (MB_ROW_COMP *)(((ENCODETHREAD_DATA *)p_data)->ptr2);
ENTROPY_CONTEXT_PLANES mb_row_left_context; ENTROPY_CONTEXT_PLANES mb_row_left_context;
const int nsync = cpi->mt_sync_range;
while (1) while (1)
{ {
if (cpi->b_multi_threaded == 0) if (cpi->b_multi_threaded == 0)
...@@ -68,6 +66,7 @@ THREAD_FUNCTION thread_encoding_proc(void *p_data) ...@@ -68,6 +66,7 @@ THREAD_FUNCTION thread_encoding_proc(void *p_data)
if (sem_wait(&cpi->h_event_start_encoding[ithread]) == 0) if (sem_wait(&cpi->h_event_start_encoding[ithread]) == 0)
{ {
const int nsync = cpi->mt_sync_range;
VP8_COMMON *cm = &cpi->common; VP8_COMMON *cm = &cpi->common;
int mb_row; int mb_row;
MACROBLOCK *x = &mbri->mb; MACROBLOCK *x = &mbri->mb;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment