This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#8104 - playback.c consistency and track count
Attached to Project:
Rockbox
Opened by Bertrik Sikken (bertrik) - Tuesday, 06 November 2007, 21:59 GMT+2
Last edited by Nicolas Pennequin (nicolas_p) - Monday, 19 November 2007, 17:38 GMT+2
Opened by Bertrik Sikken (bertrik) - Tuesday, 06 November 2007, 21:59 GMT+2
Last edited by Nicolas Pennequin (nicolas_p) - Monday, 19 November 2007, 17:38 GMT+2
|
DetailsI noticed that track_widx and track_ridx in playback.c are not always updated in the same way (with the wrap-around). Patch playback1.txt corrects this and should have no functional impact.
Patch playback2.txt goes a bit further. It simplifies functions audio_have_tracks, audio_have_free_tracks and audio_track_count by using just the track_widx and track_ridx pointers to determine how much of the track buffer is used/free. This clears up a few 'ifs' for corner cases and replaces it by a simpler unconditional calculation. This new implementation is not 100% identical to the original implementation as the exact intention of the original functions was not completely clear to me. |
This task depends upon
Closed by Nicolas Pennequin (nicolas_p)
Monday, 19 November 2007, 17:38 GMT+2
Reason for closing: Accepted
Additional comments about closing: Thanks!
Monday, 19 November 2007, 17:38 GMT+2
Reason for closing: Accepted
Additional comments about closing: Thanks!
Reading "the exact intention of the original functions was not completely clear to me" made me smile, because I had the exact same problem and it's why I didn't touch these parts of the code ;)