GList *l = NULL;
MMPLAYER_RETURN_VAL_IF_FAIL(player, NULL);
gboolean ret = TRUE;
+ gint64 end_time = 0;
/* check DRC, if it is, destroy the prev bo list to create again */
if (player->video_bo_size != size) {
}
}
+ if (player->ini.video_bo_timeout > 0)
+ end_time = g_get_monotonic_time() + player->ini.video_bo_timeout * G_TIME_SPAN_SECOND;
+
while (TRUE) {
/* get bo from list*/
for (l = g_list_first(player->video_bo_list); l; l = g_list_next(l)) {
return tbm_bo_ref(tmp->bo);
}
}
- if (!ret) {
- LOGE("failed to get bo in %d timeout", player->ini.video_bo_timeout);
- MMPLAYER_VIDEO_BO_UNLOCK(player);
- return NULL;
- }
if (player->ini.video_bo_timeout <= 0) {
MMPLAYER_VIDEO_BO_WAIT(player);
} else {
- gint64 timeout = g_get_monotonic_time() + player->ini.video_bo_timeout * G_TIME_SPAN_SECOND;
- ret = MMPLAYER_VIDEO_BO_WAIT_UNTIL(player, timeout);
+ ret = MMPLAYER_VIDEO_BO_WAIT_UNTIL(player, end_time);
+ if (!ret) {
+ LOGE("failed to get bo in %d timeout", player->ini.video_bo_timeout);
+ break;
+ }
}
- continue;
}
+
+ MMPLAYER_VIDEO_BO_UNLOCK(player);
+ return NULL;
}
static void