FS#8914 - WPS %mp tag inconsistency
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
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.
* 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;
Sunday, 20 April 2008, 20:07 GMT
Reason for closing: Fixed
Additional comments about closing: Thanks!