From: Andre Noll Date: Sat, 12 Apr 2008 17:34:04 +0000 (+0200) Subject: Simplify vss_status_tohuman() and add a comment. X-Git-Tag: v0.3.3~75 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=9902762e74e41165dfa18606411cef86ac7afd5d Simplify vss_status_tohuman() and add a comment. --- diff --git a/command.c b/command.c index b63eef04..b3d9855f 100644 --- a/command.c +++ b/command.c @@ -61,17 +61,20 @@ static void mmd_dup(struct misc_meta_data *new_mmd) } /* - * compute human readable string containing - * vss status for given integer value + * Compute human readable string containing vss status for given integer value. + * + * We don't want to use vss_playing() and friends here because we take a + * snapshot of the mmd struct and use the copy for computing the state of the + * vss. If the real data were used, we would take the mmd lock for a rather + * long time or risk to get an inconsistent view. */ static char *vss_status_tohuman(unsigned int flags) { if (flags & VSS_PLAYING) return para_strdup("playing"); - else if (flags & VSS_NEXT) + if (flags & VSS_NEXT) return para_strdup("stopped"); - else - return para_strdup("paused"); + return para_strdup("paused"); } /*