author | Jian Xu <jian.xu@amlogic.com> | 2016-07-05 13:22:24 (GMT) |
---|---|---|
committer | Jian Xu <jian.xu@amlogic.com> | 2016-07-05 13:22:24 (GMT) |
commit | fcbb5bad18023f752e1508f31f6804645334bc58 (patch) | |
tree | 70d245d14aa8fd22801593f9808dd583162e74df | |
parent | 7569a0672512b05eb6c8d0e8d413524694bdad46 (diff) | |
download | audio-fcbb5bad18023f752e1508f31f6804645334bc58.zip audio-fcbb5bad18023f752e1508f31f6804645334bc58.tar.gz audio-fcbb5bad18023f752e1508f31f6804645334bc58.tar.bz2 |
PD#128074: audio: fix libtvaudio thread pid screw up issue
Change-Id: Ib07a6565897147e646146f20f61fb90da59c97ae
-rwxr-xr-x[-rw-r--r--] | libTVaudio/audio/aml_audio.c | 3 | ||||
-rwxr-xr-x[-rw-r--r--] | libTVaudio/audio/audio_usb_check.cpp | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/libTVaudio/audio/aml_audio.c b/libTVaudio/audio/aml_audio.c index cef7fb7..a034bb8 100644..100755 --- a/libTVaudio/audio/aml_audio.c +++ b/libTVaudio/audio/aml_audio.c @@ -1652,7 +1652,7 @@ static void* aml_audio_threadloop(void *data __unused) { gUSBCheckFlag = 0; gpAmlDevice->aml_Audio_ThreadExecFlag = 1; - + prctl(PR_SET_NAME, (unsigned long)"aml_TV_audio"); ret = aml_device_init(gpAmlDevice); if (ret < 0) { ALOGE("%s, Devices fail opened!\n", __FUNCTION__); @@ -1825,7 +1825,6 @@ int aml_audio_open(unsigned int sr, int input_device, int output_device) { pthread_mutex_unlock(&amaudio_dev_op_mutex); return -1; } - prctl(PR_SET_NAME, (unsigned long)"aml_TV_audio"); creat_pthread_for_android_check(&gpAmlDevice->android_check_ThreadID); diff --git a/libTVaudio/audio/audio_usb_check.cpp b/libTVaudio/audio/audio_usb_check.cpp index 705e59f..2867acc 100644..100755 --- a/libTVaudio/audio/audio_usb_check.cpp +++ b/libTVaudio/audio/audio_usb_check.cpp @@ -98,15 +98,15 @@ static int SetAudioDelay(void) { static int running_flag = 0; void* android_check_threadloop(void *data __unused) { - running_flag = 1; - //ALOGI("Start thread loop for android check!\n"); + ALOGI("Start thread loop for android audio check!\n"); + prctl(PR_SET_NAME, (unsigned long)"aml_audio_check"); while (running_flag) { android::GetStreamVolume(); android::GetDeviceID(); android::SetAudioDelay(); usleep(100*1000); } - //ALOGI("Exit thread loop for android check!\n"); + ALOGI("Exit thread loop for android audio check!\n"); return ((void *) 0); } @@ -121,6 +121,7 @@ extern "C" int creat_pthread_for_android_check //param.sched_priority = sched_get_priority_max(SCHED_RR); param.sched_priority = 50; pthread_attr_setschedparam(&attr, ¶m); + running_flag = 1; ret = pthread_create(android_check_ThreadID, &attr, &android_check_threadloop, NULL); pthread_attr_destroy(&attr); @@ -128,7 +129,6 @@ extern "C" int creat_pthread_for_android_check ALOGE("%s, Create thread fail!\n", __FUNCTION__); return -1; } - prctl(PR_SET_NAME, (unsigned long)"aml_TV_check"); //ALOGI("Creat thread ID: %u!\n", *android_check_ThreadID); return 0; } |