X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=afs.c;h=2d4184d239e6d1f54ef6fb41bdbe1591e89c0195;hp=b9d24331148263bfeca4ae075a989ca89eeeb3fb;hb=60216e4058f4ecc24467df577e51cb2bd66508b0;hpb=c5fa571f434b45ab8f786cf20e8c22d197a00da2 diff --git a/afs.c b/afs.c index b9d24331..2d4184d2 100644 --- a/afs.c +++ b/afs.c @@ -37,6 +37,7 @@ extern const char *status_item_list[]; static struct timeval announce_tv; static struct timeval data_send_barrier; static struct timeval eof_barrier; +static struct timeval autoplay_barrier; extern struct misc_meta_data *mmd; extern struct audio_file_selector selectors[]; @@ -166,6 +167,14 @@ void afs_init(void) } free(hn); free(home); + if (conf.autoplay_given) { + struct timeval now, tmp; + mmd->afs_status_flags |= AFS_PLAYING; + mmd->new_afs_status_flags |= AFS_PLAYING; + gettimeofday(&now, NULL); + ms2tv(conf.autoplay_delay_arg, &tmp); + tv_add(&now, &tmp, &autoplay_barrier); + } } static int get_file_info(int i) @@ -325,6 +334,9 @@ static struct timeval *afs_compute_timeout(void) return &the_timeout; } gettimeofday(&now, NULL); + if (chk_barrier("autoplay_delay", &now, &autoplay_barrier, + &the_timeout, 1) < 0) + return &the_timeout; if (chk_barrier("eof", &now, &eof_barrier, &the_timeout, 1) < 0) return &the_timeout; if (chk_barrier("data send", &now, &data_send_barrier,