FS#8914 - WPS %mp tag inconsistency

Attached to Project: Rockbox
Opened by Bertrik Sikken (bertrik) - Sunday, 20 April 2008, 10:02 GMT
Last edited by Nicolas Pennequin (nicolas_p) - Sunday, 20 April 2008, 20:07 GMT
Task Type Bugs
Category Themes
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


The WPS %pm tag is described here as having values from 0 to 4:
but the code assigns a value from 1 to 5 in gwps-common.c line 1105.
I think this is a bug.

Other remarks:
* The \ at the end of the line can be removed safely
* Instead of calling audio_status(), it is possible to use the cached value 'status'
* if condition (status == AUDIO_STATUS_PLAY) is TRUE, it is useless to check condition !(status & AUDIO_STATUS_PAUSE) since it will always be false.

Suggested simplified code:
int status = audio_status();
int mode = 0;
if (status == AUDIO_STATUS_PLAY)
mode = 1;
if ((status & AUDIO_STATUS_PAUSE) && (! status_get_ffmode()))
mode = 2;
if (status_get_ffmode() == STATUS_FASTFORWARD)
mode = 3;
if (status_get_ffmode() == STATUS_FASTBACKWARD)
mode = 4;
This task depends upon

Closed by  Nicolas Pennequin (nicolas_p)
Sunday, 20 April 2008, 20:07 GMT
Reason for closing:  Fixed
Additional comments about closing:  Thanks!