fix: ensure OTA prompt plays before upgrade
This commit is contained in:
@@ -280,10 +280,11 @@ u32 local_mp3_data_fetch(const char *uri, uint8_t *buffer, u32 length)
|
||||
|
||||
size_t url_mp3_data_fetch(const char *uri, uint8_t *buffer, size_t length)
|
||||
{
|
||||
int resp_status = -1;
|
||||
uint32_t nw = length;
|
||||
uint32_t page_pos = 0;
|
||||
int error_cnt = 0;
|
||||
int resp_status = -1;
|
||||
uint32_t nw = length;
|
||||
uint32_t page_pos = 0;
|
||||
uint32_t content_length = 0;
|
||||
int error_cnt = 0;
|
||||
|
||||
//printf("fd_fetch start\n");
|
||||
session = webclient_session_create(1024);
|
||||
@@ -306,11 +307,12 @@ size_t url_mp3_data_fetch(const char *uri, uint8_t *buffer, size_t length)
|
||||
goto __exit;
|
||||
}
|
||||
|
||||
if (session->content_length == 0)
|
||||
{
|
||||
printf("Request file size is 0!");
|
||||
goto __exit;
|
||||
}
|
||||
if (session->content_length == 0)
|
||||
{
|
||||
printf("Request file size is 0!");
|
||||
goto __exit;
|
||||
}
|
||||
content_length = session->content_length;
|
||||
|
||||
printf("start read\n");
|
||||
if(total_length < session->content_length)
|
||||
@@ -325,7 +327,7 @@ size_t url_mp3_data_fetch(const char *uri, uint8_t *buffer, size_t length)
|
||||
page_pos = 0;
|
||||
do
|
||||
{
|
||||
if(vad_audio_is_recording()) {
|
||||
if(vad_audio_is_recording() || tts_playing_ret()==2) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -361,7 +363,7 @@ __exit:
|
||||
session = NULL;
|
||||
}
|
||||
|
||||
if(total_length<session->content_length){
|
||||
if(total_length<content_length){
|
||||
total_length = 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user