File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,9 @@ static void audio_player_task(void *pvParameters)
6262 mad_frame_init (frame );
6363 mad_synth_init (synth );
6464
65- mad_stream_buffer (stream , (const unsigned char * )mp3_file_ptr [mp3_file_index ][0 ],
66- mp3_file_ptr [mp3_file_index ][1 ] - mp3_file_ptr [mp3_file_index ][0 ]
65+ mad_stream_buffer (
66+ stream , (const unsigned char * )mp3_file_ptr [mp3_file_index ][0 ],
67+ mp3_file_ptr [mp3_file_index ][1 ] - mp3_file_ptr [mp3_file_index ][0 ]
6768 );
6869
6970 while (1 ) {
@@ -105,6 +106,9 @@ void audio_player_play_file(uint8_t idx)
105106 ESP_LOGE (TAG , "invalid file index" );
106107 return ;
107108 }
109+ if (mp3_file_ptr [idx ][0 ] == NULL || mp3_file_ptr [idx ][1 ] == NULL ) {
110+ return ;
111+ }
108112 mp3_file_index = idx ;
109113 EventBits_t uxBits = xEventGroupGetBits (user_event_group );
110114 if (uxBits & AUDIO_PLAYER_RUN_BIT ) {
You can’t perform that action at this time.
0 commit comments