*/
char *get_time_string(void)
{
- int ret, seconds = 0, length;
+ int ret, seconds = 0, length = stat_task->length_seconds;
struct timeval *tmp, sum, sss, /* server stream start */
rstime, /* receiver start time */
wstime, /* writer start time */
if (audiod_status == AUDIOD_OFF)
goto empty;
- if (!(stat_task->vss_status & VSS_STATUS_FLAG_PLAYING)) {
- if (stat_task->length_seconds) /* paused */
+ if (stat_task->server_stream_start.tv_sec == 0) {
+ if (stat_task->vss_status & VSS_STATUS_FLAG_PLAYING)
+ goto out; /* server is about to change file */
+ if (length > 0) /* paused */
return NULL;
goto empty; /* stopped */
}
* start. We use the slot info and fall back to the info from current
* status items if no slot info is available.
*/
- length = stat_task->length_seconds;
tmp = &stat_task->server_stream_start;
if (s && s->wns && s->wns[0].btrn) { /* writer active in this slot */
btr_get_node_start(s->wns[0].btrn, &wstime);
tv_diff(tmp, &stat_task->sa_time_diff, &sss);
else
tv_add(tmp, &stat_task->sa_time_diff, &sss);
- if (!s || !s->wns || !s->wns[0].btrn) {
+ if (!s || !s->wns || !s->wns[0].btrn || wstime.tv_sec == 0) {
struct timeval diff;
tv_diff(now, &sss, &diff);
seconds = diff.tv_sec + stat_task->offset_seconds;