Skip to content

Commit 73a1002

Browse files
committed
fix(avi_player): fix potential errors that may occur during deinitialization
1 parent c64bd35 commit 73a1002

File tree

7 files changed

+22
-2
lines changed

7 files changed

+22
-2
lines changed

components/avi_player/avi_player.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ static const char *TAG = "avi player";
2323
#define EVENT_START_PLAY ((1 << 1))
2424
#define EVENT_STOP_PLAY ((1 << 2))
2525
#define EVENT_DEINIT ((1 << 3))
26-
#define EVENT_VIDEO_BUF_READY ((1 << 4))
27-
#define EVENT_AUDIO_BUF_READY ((1 << 5))
26+
#define EVENT_DEINIT_DONE ((1 << 4))
27+
#define EVENT_VIDEO_BUF_READY ((1 << 5))
28+
#define EVENT_AUDIO_BUF_READY ((1 << 6))
2829

2930
#define EVENT_ALL (EVENT_FPS_TIME_UP | EVENT_START_PLAY | EVENT_STOP_PLAY | EVENT_DEINIT)
3031

@@ -266,6 +267,7 @@ static void avi_player_task(void *args)
266267
}
267268

268269
}
270+
xEventGroupSetBits(s_avi->event_group, EVENT_DEINIT_DONE);
269271
vTaskDelete(NULL);
270272
}
271273

@@ -395,6 +397,13 @@ esp_err_t avi_player_deinit(void)
395397
return ESP_FAIL;
396398
}
397399

400+
xEventGroupSetBits(s_avi->event_group, EVENT_DEINIT);
401+
EventBits_t uxBits = xEventGroupWaitBits(s_avi->event_group, EVENT_DEINIT_DONE, pdTRUE, pdTRUE, pdMS_TO_TICKS(1000));
402+
if (!(uxBits & EVENT_DEINIT_DONE)) {
403+
ESP_LOGE(TAG, "AVI player deinit timeout");
404+
return ESP_ERR_TIMEOUT;
405+
}
406+
398407
if (s_avi->timer_handle != NULL) {
399408
esp_timer_stop(s_avi->timer_handle);
400409
esp_timer_delete(s_avi->timer_handle);

docs/en/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ ESP-IoT-Solution contains device drivers and code frameworks for the development
6868
Display <display/index>
6969
USB Host&Device <usb/index>
7070
Audio <audio/index>
71+
Multimedia <multimedia/index>
7172
GUI <gui/index>
7273
AI <ai/index>
7374
Input Device <input_device/index>

examples/usb/device/usb_dual_uvc_device/main/idf_component.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ dependencies:
1414
avi_player:
1515
version: "0.*"
1616
override_path: "../../../../../components/avi_player"
17+
lvgl/lvgl: #temp to workaround bsp issue
18+
version: "9.2.0"

examples/usb/device/usb_extend_screen/main/idf_component.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ dependencies:
77
version: "*"
88
espressif/esp_lcd_ek79007: "*"
99
espressif/esp_codec_dev: "1.3.0"
10+
lvgl/lvgl: #temp to workaround bsp issue
11+
version: "9.2.0"

examples/usb/device/usb_surface_dial/main/idf_component.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ dependencies:
1515
version: "^1.5.1"
1616
rules:
1717
- if: "target in [esp32s3]"
18+
lvgl/lvgl: #temp to workaround bsp issue
19+
version: "9.2.0"

examples/usb/host/usb_cdc_4g_module/main/idf_component.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ dependencies:
1212
version: "^1.5.1"
1313
rules:
1414
- if: "target in [esp32s3]"
15+
lvgl/lvgl: #temp to workaround bsp issue
16+
version: "9.2.0"

examples/usb/host/usb_msc_ota/main/idf_component.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ dependencies:
1010
version: "^1.5.1"
1111
rules:
1212
- if: "target in [esp32s3]"
13+
lvgl/lvgl: #temp to workaround bsp issue
14+
version: "9.2.0"

0 commit comments

Comments
 (0)