From: Andre Noll Date: Sun, 22 Sep 2013 14:45:10 +0000 (+0200) Subject: play: Fix prev command. X-Git-Tag: v0.5.1~8^2 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=20c8622c90f488ab398146a9e5b51d61149e96d3;p=paraslash.git play: Fix prev command. The command handler for com_prev() stores the number of the previous (valid) file in ->next_file of struct play_task and sets ->rq to CRT_FILE_CHANGE. The real work is supposed to be done in load_next_file() which is called from the main post_select() function. However, load_next_file() ignores ->next_file and computes the number of the next file itself. Hence the "prev" command acts exactly as "next", i.e. it selects the next rather than the previous file. Fix this by ignoring ->next_file only if ->rq is CRT_NONE, which indicates a normal end of file condition. --- diff --git a/play.c b/play.c index 6eed58ab..01125ab6 100644 --- a/play.c +++ b/play.c @@ -431,7 +431,7 @@ static int load_next_file(struct play_task *pt) int ret; again: - if (pt->rq == CRT_NONE || pt->rq == CRT_FILE_CHANGE) { + if (pt->rq == CRT_NONE) { pt->start_chunk = 0; ret = next_valid_file(pt); if (ret < 0)