diff --git a/components/vision/port/maixcam/maix_rtsp_maixcam.cpp b/components/vision/port/maixcam/maix_rtsp_maixcam.cpp index 608d0c7f..9f823340 100644 --- a/components/vision/port/maixcam/maix_rtsp_maixcam.cpp +++ b/components/vision/port/maixcam/maix_rtsp_maixcam.cpp @@ -214,6 +214,9 @@ namespace maix::rtsp delete param->rtsp_server; param->rtsp_server = nullptr; } + + free(_param); + _param = nullptr; } for (auto ®ion : this->_region_list) { @@ -474,6 +477,11 @@ namespace maix::rtsp _thread = nullptr; } + while (param->status != RTSP_IDLE) { + time::sleep_ms(100); + log::info("wait rtsp thread exit.."); + } + if (param->ffmpeg_packer) { delete param->ffmpeg_packer; param->ffmpeg_packer = nullptr; diff --git a/components/voice/port/maixcam/maix_audio_mmf.cpp b/components/voice/port/maixcam/maix_audio_mmf.cpp index c44c4004..810737c3 100644 --- a/components/voice/port/maixcam/maix_audio_mmf.cpp +++ b/components/voice/port/maixcam/maix_audio_mmf.cpp @@ -246,7 +246,7 @@ namespace maix::audio int frame_byte = snd_pcm_format_width(format) / 8; if (buffer_size < frame_byte * channels * frame_size) { printf("Bad buffer size, input %ld, need %d\r\n", buffer_size, frame_byte * channels * frame_size); - return 0; + return -1; } if ((len = (int)snd_pcm_readi(handle, buffer, frame_size)) < 0) {