OSDN Git Service

h264encode: fix thread lockup issue
authorAustin Yuan <shengquan.yuan@intel.com>
Thu, 9 May 2013 10:36:04 +0000 (18:36 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Tue, 25 Jun 2013 05:53:58 +0000 (13:53 +0800)
Change-Id: I6065525f76796603856f5cebf0468f4a59c4b5b5
Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>
test/encode/h264encode.c

index e34f6b4..7365008 100644 (file)
@@ -1841,7 +1841,6 @@ static void storage_task(unsigned long long display_order, unsigned long long en
 
     pthread_mutex_lock(&encode_mutex);
     srcsurface_status[display_order % SURFACE_NUM] = SRC_SURFACE_IN_ENCODING;
-    pthread_cond_signal(&encode_cond);
     pthread_mutex_unlock(&encode_mutex);
 }
 
@@ -1908,9 +1907,7 @@ static int encode_frames(void)
 
         /* check if the source frame is ready */
         while (srcsurface_status[current_slot] != SRC_SURFACE_IN_ENCODING) {
-            pthread_mutex_lock(&encode_mutex);
-            pthread_cond_wait(&encode_cond, &encode_mutex);
-            pthread_mutex_unlock(&encode_mutex);
+            usleep(1);
         }
         
         tmp = GetTickCount();