if (pt->num_chunks == 0 || pt->seconds == 0)
return 0;
/* where the stream started (in seconds) */
- result = pt->start_chunk * pt->seconds / pt->num_chunks;
+ result = (uint64_t)pt->start_chunk * pt->seconds / pt->num_chunks;
if (pt->wn.btrn) { /* Add the uptime of the writer node */
struct timeval diff = {.tv_sec = 0}, wstime;
btr_get_node_start(pt->wn.btrn, &wstime);
return com_next(NULL);
if (pt->playing && !pt->fn.btrn)
return 0;
- pt->start_chunk = percent * pt->num_chunks / 100;
+ pt->start_chunk = (uint64_t)percent * pt->num_chunks / 100;
if (!pt->playing)
return 0;
pt->rq = CRT_REPOS;
seconds += get_play_time();
seconds = PARA_MIN(seconds, (typeof(seconds))pt->seconds - 4);
seconds = PARA_MAX(seconds, 0);
- pt->start_chunk = pt->num_chunks * seconds / pt->seconds;
+ pt->start_chunk = (uint64_t)pt->num_chunks * seconds / pt->seconds;
pt->start_chunk = PARA_MIN(pt->start_chunk, pt->num_chunks - 1);
pt->start_chunk = PARA_MAX(pt->start_chunk, 0UL);
if (!pt->playing)