|
@@ -902,13 +902,13 @@ int audio_stop_playaudio(audio_context_t* audio_ctx)
|
|
|
if (AUDIO_STRM_ON == audio_ctx->play_stream_flag){
|
|
|
audio_ctx->play_stream_flag = AUDIO_STRM_OFF;
|
|
|
if (0 != audio_ctx->writethreadid) {
|
|
|
- //if (0 == pthread_join(audio_ctx->writethreadid, NULL)) {
|
|
|
- struct timespec ts;
|
|
|
- clock_gettime(CLOCK_REALTIME, &ts);
|
|
|
- long unsec = ts.tv_nsec + (1000 * 1000 * 1000);
|
|
|
- ts.tv_sec += (unsec / 1000000000);
|
|
|
- ts.tv_nsec = (unsec % 1000000000);
|
|
|
- if (0 == pthread_timedjoin_np(audio_ctx->writethreadid, NULL, &ts)) {
|
|
|
+ if (0 == pthread_join(audio_ctx->writethreadid, NULL)) {
|
|
|
+ //struct timespec ts;
|
|
|
+ //clock_gettime(CLOCK_REALTIME, &ts);
|
|
|
+ //long unsec = ts.tv_nsec + (1000 * 1000 * 1000);
|
|
|
+ //ts.tv_sec += (unsec / 1000000000);
|
|
|
+ //ts.tv_nsec = (unsec % 1000000000);
|
|
|
+ //if (0 == pthread_timedjoin_np(audio_ctx->writethreadid, NULL, &ts)) {
|
|
|
audio_log_v(AUDIO_LOG_LEVEL_INFO, "%s:%d pulse audio write thread %u joined success.", __FUNCTION__, __LINE__, audio_ctx->writethreadid);
|
|
|
audio_ctx->writethreadid = 0;
|
|
|
}
|
|
@@ -928,13 +928,13 @@ int audio_stop_pulseaudio(audio_context_t* audio_ctx)
|
|
|
if (AUDIO_STRM_ON == audio_ctx->stream_flag){
|
|
|
audio_ctx->stream_flag = AUDIO_STRM_OFF;
|
|
|
if (0 != audio_ctx->readthreadid){
|
|
|
- //if (0 == pthread_join(audio_ctx->readthreadid, NULL)) {
|
|
|
- struct timespec ts;
|
|
|
- clock_gettime(CLOCK_REALTIME, &ts);
|
|
|
- long unsec = ts.tv_nsec + (1000 * 1000 * 1000);
|
|
|
- ts.tv_sec += (unsec / 1000000000);
|
|
|
- ts.tv_nsec = (unsec % 1000000000);
|
|
|
- if (0 == pthread_timedjoin_np(audio_ctx->readthreadid, NULL, &ts)) {
|
|
|
+ if (0 == pthread_join(audio_ctx->readthreadid, NULL)) {
|
|
|
+ //struct timespec ts;
|
|
|
+ //clock_gettime(CLOCK_REALTIME, &ts);
|
|
|
+ //long unsec = ts.tv_nsec + (1000 * 1000 * 1000);
|
|
|
+ //ts.tv_sec += (unsec / 1000000000);
|
|
|
+ //ts.tv_nsec = (unsec % 1000000000);
|
|
|
+ //if (0 == pthread_timedjoin_np(audio_ctx->readthreadid, NULL, &ts)) {
|
|
|
audio_log_v(AUDIO_LOG_LEVEL_INFO, "%s:%d pulse audio read thread %u joined success.", __FUNCTION__, __LINE__, audio_ctx->readthreadid);
|
|
|
audio_ctx->readthreadid = 0;
|
|
|
}
|