From fb6d93240bb9c7c3d2c8e1826d722296002fb487 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Thu, 7 Jan 2010 00:45:25 +0100 Subject: [PATCH] vss: Update offset directly when setting the REPOS flag. This way, the new offset is used during the next announce period. --- vss.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vss.c b/vss.c index 0b6735ba..fef61cbe 100644 --- a/vss.c +++ b/vss.c @@ -636,7 +636,7 @@ static void vss_eof(struct vss_task *vsst) para_munmap(vsst->map, mmd->size); vsst->map = NULL; mmd->chunks_sent = 0; - mmd->offset = 0; + //mmd->offset = 0; mmd->afd.afhi.seconds_total = 0; mmd->afd.afhi.chunk_tv.tv_sec = 0; mmd->afd.afhi.chunk_tv.tv_usec = 0; @@ -716,11 +716,14 @@ static void vss_pre_select(struct sched *s, struct task *t) set_eof_barrier(vsst); mmd->chunks_sent = 0; } else if (vss_repos()) { + struct timeval offset; tv_add(now, &vsst->announce_tv, &vsst->data_send_barrier); set_eof_barrier(vsst); mmd->chunks_sent = 0; mmd->current_chunk = mmd->repos_request; mmd->new_vss_status_flags &= ~VSS_REPOS; + tv_scale(mmd->current_chunk, &mmd->afd.afhi.chunk_tv, &offset); + mmd->offset = tv2ms(&offset); } if (need_to_request_new_audio_file(vsst)) { PARA_DEBUG_LOG("ready and playing, but no audio file\n"); @@ -875,10 +878,7 @@ static void vss_send(struct vss_task *vsst) size_t len; if (!mmd->chunks_sent) { - struct timeval tmp; mmd->stream_start = *now; - tv_scale(mmd->current_chunk, &mmd->afd.afhi.chunk_tv, &tmp); - mmd->offset = tv2ms(&tmp); mmd->events++; } /* -- 2.39.5