|
@@ -131,7 +131,7 @@ static int audio_decode_thread(void *arg)
|
|
|
tb = { 1, p_frame->sample_rate };
|
|
|
|
|
|
//从frame队列找到一个可写的空间,若未停止则一直等待,已停止时返回NULL
|
|
|
- if (!(af = frame_queue_peek_writable(&is->audio_frm_queue, !is->bread_finished))) {
|
|
|
+ if (!(af = frame_queue_peek_writable(&is->audio_frm_queue, true))) {
|
|
|
is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "frame_queue_peek_writable return NULL, goto end.");
|
|
|
goto the_end;
|
|
|
}
|
|
@@ -151,8 +151,6 @@ static int audio_decode_thread(void *arg)
|
|
|
the_end:
|
|
|
|
|
|
av_frame_free(&p_frame);
|
|
|
- //SDL_Delay(100);
|
|
|
- //is->abort_request = 1;
|
|
|
is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "audio decode thread exit, thread id is %u, and is->abort_request = %d", SDL_ThreadID(), is->abort_request);
|
|
|
|
|
|
return ret;
|
|
@@ -234,7 +232,6 @@ static int audio_resample(player_stat_t *is, int64_t audio_callback_time)
|
|
|
#endif
|
|
|
|
|
|
// 若队列头部可读,则由af指向可读帧
|
|
|
- is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "%s:%d is->bread_finished=%d", __FUNCTION__, __LINE__, is->bread_finished);
|
|
|
if (!(af = frame_queue_peek_readable(&is->audio_frm_queue, !is->bread_finished))) {
|
|
|
is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "%s:%d abort_request flag is true, function return", __FUNCTION__, __LINE__);
|
|
|
return -2;
|
|
@@ -426,7 +423,7 @@ static int open_audio_playing(void *arg)
|
|
|
//SDL_PauseAudioDevice(idev, 0);
|
|
|
|
|
|
while (is->abort_request == 0){
|
|
|
- SDL_Delay(10);
|
|
|
+ SDL_Delay(1);
|
|
|
}
|
|
|
is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "----------%s:%d before SDL Close Audio", __FUNCTION__, __LINE__);
|
|
|
SDL_CloseAudio();
|