audio: T950s_HUI testcase[AV-HDMI] [1/1]

PD#SWPL-202036

Problem:
audio_patch_output_threadloop will wait patch->cond, when ring buffer
data is
not enough. This will prevent the thread from exiting quickly.

Solution:
Send patch->cond signal during the release patch to ensure fast
output-thread exit.

Verify:
yocto-t6d

Change-Id: I7a95277d13082ba1b3bc9a3ba01e3a2969ed622f
Signed-off-by: yayun.shi <yayun.shi@amlogic.com>
(cherry picked from commit ca77516f50e28d1f41d44c2632d7f3c62cf35136)
diff --git a/input/tv_patch.c b/input/tv_patch.c
index 0dcbb73..a34c892 100644
--- a/input/tv_patch.c
+++ b/input/tv_patch.c
@@ -607,6 +607,11 @@
             // wait 300ms
             ts_wait_time(&ts, 300000);
             pthread_cond_timedwait(&patch->cond, &patch->mutex, &ts);
+            if (patch->output_thread_exit) {
+                AM_LOGI("need to exit");
+                pthread_mutex_unlock(&patch->mutex);
+                break;
+            }
         }
         pthread_mutex_unlock(&patch->mutex);
 
@@ -812,6 +817,7 @@
     //invalidate_dev_patch(aml_dev);
 
     patch->output_thread_exit = 1;
+    pthread_cond_signal(&patch->cond);
     pthread_join(patch->audio_output_threadID, NULL);
 
     patch->input_thread_exit = 1;