X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=audiod.c;h=380e53e0fbae30cf9c949afea6d247d71396eb37;hp=32047a1f9aae8d8c69adefe82e12a82e7bfcf00f;hb=a3ca7d25b3034f0363a88db798d0ee3e46bf4e49;hpb=45b4e8b0ba410fd929a341a9bf84b1ac3995d734 diff --git a/audiod.c b/audiod.c index 32047a1f..380e53e0 100644 --- a/audiod.c +++ b/audiod.c @@ -633,6 +633,8 @@ static bool must_start_decoder(void) int cafn = stat_task->current_audio_format_num; unsigned vs = stat_task->vss_status; + if (audiod_status != AUDIOD_ON) + return false; if (cafn < 0) return false; if (!stat_task->ct) @@ -1026,6 +1028,7 @@ static void command_post_select(struct sched *s, struct task *t) ret = handle_connect(ct->fd); if (ret < 0) PARA_ERROR_LOG("%s\n", para_strerror(-ret)); + audiod_status_dump(); } static void init_command_task(struct command_task *ct) @@ -1149,10 +1152,19 @@ static void status_pre_select(struct sched *s, struct task *t) ret = btr_node_status(st->btrn, 0, BTR_NT_LEAF); if (ret > 0) goto min_delay; - if (!st->ct) + if (st->ct && audiod_status == AUDIOD_OFF) + goto min_delay; + if (!st->ct && audiod_status != AUDIOD_OFF) sched_request_barrier_or_min_delay(&st->restart_barrier, s); if (cafn >= 0) sched_request_barrier(&afi[cafn].restart_barrier, s); + /* + * If para_server is playing we'd like to have a smooth time display + * even if we are running in standby mode. So we request a timeout that + * expires at the next full second. + */ + if (stat_task->vss_status & VSS_STATUS_FLAG_PLAYING) + sched_request_timeout_ms(1000 - now->tv_usec / 1000, s); return; min_delay: sched_min_delay(s);