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.
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)