Skip to content
Snippets Groups Projects
Commit cf5da04f authored by dos's avatar dos Committed by pippin
Browse files

st3m: media: Don't count the seeking time to next think's delta

parent bed1ec3f
No related branches found
No related tags found
1 merge request!558Various media improvements
...@@ -31,10 +31,15 @@ static void st3m_media_task(void *_arg) { ...@@ -31,10 +31,15 @@ static void st3m_media_task(void *_arg) {
vTaskDelayUntil(&wake_time, 20 / portTICK_PERIOD_MS); vTaskDelayUntil(&wake_time, 20 / portTICK_PERIOD_MS);
if (media_item->think) { if (media_item->think) {
if (xSemaphoreTake(media_lock, portMAX_DELAY)) { if (xSemaphoreTake(media_lock, portMAX_DELAY)) {
bool seeking = media_item->seek != -1;
ticks = xTaskGetTickCount(); ticks = xTaskGetTickCount();
media_item->think(media_item, media_item->think(media_item,
(ticks - last_think) * portTICK_PERIOD_MS); (ticks - last_think) * portTICK_PERIOD_MS);
last_think = ticks; last_think = ticks;
if (seeking && media_item->seek == -1) {
// don't count seeking time into delta
last_think = xTaskGetTickCount();
}
xSemaphoreGive(media_lock); xSemaphoreGive(media_lock);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment