FS#1088 - Init paused flag in wps_show()

Attached to Project: Rockbox
Opened by Craig Sather (rb_dev) - Thursday, 13 March 2003, 10:57 GMT
Last edited by Linus Nielsen Feltzing (linusnielsen) - Saturday, 15 March 2003, 12:23 GMT
Task Type Patches
Status Closed
Assigned To No-one
Operating System
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


We must init paused mode to false when we enter wps_show(), else paused flag might be equal to true
while we are in play mode, causing some odd effects.

1) While a track is playing press pause
2) Browse to an mp3 file
3) Play the file

Now we are playing but paused=true, so pressing Fast Fwd or Rewind does not stop mpeg play because
ffwd_rew() thinks we are already paused.

This task depends upon

Closed by  Linus Nielsen Feltzing (linusnielsen)
Saturday, 15 March 2003, 12:23 GMT
Reason for closing:  Accepted
Comment by Craig Sather (rb_dev) - Thursday, 13 March 2003, 11:38 GMT

Well, it seems that this patch fixes the problem described in
the example, but there is at least one time when we want to
enter wps_show() without reseting the paused flag. We need
some method to reset it only in cases where we know that we
should not be in paused mode (like when wps_show() is called
after a file is played), because we can enter browse mode
while paused, and in that case we should not reset the paused
flag when we call wps_show() after done browsing.
Comment by Craig Sather (rb_dev) - Friday, 14 March 2003, 11:43 GMT

Submitted patch file #2 to replace the original patch file. This patch fixes the pause state problem without causing
the problems that the first patch caused, but I had to do a 100 tick wait because it takes that long for the pause
state returned by mpeg_status() to transition from paused to not paused, and I couldn't figure out how to make it
transition faster.
Comment by Craig Sather (rb_dev) - Saturday, 15 March 2003, 11:58 GMT

With Linus' suggestion, I made a change that causes the pause
flag to be updated faster so I was able to remove the wait
before reading the mpeg status. Patch file #3 has a complete
working patch including this improvement.