}
}
+static void set_eof_barrier(struct vss_task *vsst)
+{
+ struct fec_client *fc;
+ struct timeval timeout = mmd->afd.afhi.eof_tv,
+ *chunk_tv = vss_chunk_time();
+
+ if (!chunk_tv)
+ goto out;
+ list_for_each_entry(fc, &fec_client_list, node) {
+ struct timeval group_duration;
+ tv_scale(fc->group.num_chunks, chunk_tv, &group_duration);
+ if (tv_diff(&timeout, &group_duration, NULL) < 0)
+ timeout = group_duration;
+ }
+out:
+ tv_add(now, &timeout, &vsst->eof_barrier);
+}
+
/**
* Check if vss status flag \a P (playing) is set.
*
return;
if (mmd->new_vss_status_flags & VSS_NOMORE)
mmd->new_vss_status_flags = VSS_NEXT;
- tv_add(&mmd->afd.afhi.eof_tv, now, &vsst->eof_barrier);
+ set_eof_barrier(vsst);
para_munmap(vsst->map, mmd->size);
vsst->map = NULL;
mmd->chunks_sent = 0;
vss_eof(vsst);
else if (vss_paused()) {
if (mmd->chunks_sent)
- tv_add(&mmd->afd.afhi.eof_tv, now, &vsst->eof_barrier);
+ set_eof_barrier(vsst);
mmd->chunks_sent = 0;
} else if (vss_repos()) {
tv_add(now, &vsst->announce_tv, &vsst->data_send_barrier);
- tv_add(&mmd->afd.afhi.eof_tv, now, &vsst->eof_barrier);
+ set_eof_barrier(vsst);
mmd->chunks_sent = 0;
mmd->current_chunk = mmd->repos_request;
mmd->new_vss_status_flags &= ~VSS_REPOS;