author | Jian Xu <jian.xu@amlogic.com> | 2016-07-08 02:55:45 (GMT) |
---|---|---|
committer | Gerrit Code Review <gituser@scgit.amlogic.com> | 2016-07-08 02:55:45 (GMT) |
commit | 51adc3f0816907cc7bd25a8becefda9901f8f3a4 (patch) | |
tree | 71ad190649911b4a562c0ce7602512e15edb3797 | |
parent | b93eee63979eb472f938062a8796340d82166ac2 (diff) | |
parent | fcbb5bad18023f752e1508f31f6804645334bc58 (diff) | |
download | audio-51adc3f0816907cc7bd25a8becefda9901f8f3a4.zip audio-51adc3f0816907cc7bd25a8becefda9901f8f3a4.tar.gz audio-51adc3f0816907cc7bd25a8becefda9901f8f3a4.tar.bz2 |
Merge "PD#128074: audio: fix libtvaudio thread pid screw up issue" into m-amlogic
-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; } |