• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category Operating System/Drivers
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Release 3.8.1
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by Thomas Martitz - 2011-06-14
Last edited by Thomas Martitz - 2011-08-15

FS#12159 - GSoC/Buflib: Remove direct audiobuf accesses

Replace all direct accesses to audiobuf with buffer API functions.

Namely, introduce buffer_get_buffer() and buffer_release_buffer().
buffer_get_buffer() aquires all available and grabs a lock, attempting to
call buffer_alloc() or buffer_get_buffer() while this lock is locked will cause a panicf() (doesn’t actually happen, but is for debugging purpose).
buffer_release_buffer() unlocks that lock and can additionally increment the audiobuf buffer to make an allocation. Pass 0 to only unlock if buffer was used temporarily only.
buffer_available() is a replacement function to query audiobuflen, i.e. what’s left in the buffer.

Further changes happened to mp3data.c and talk.c as to not call the above API functions, but get the buffer from callers. The caller is the audio system which has the buffer lock while mp3dat and talk mess with the buffer.
mpeg.c now implements some buffer related functions of playback.h, that no #ifdefs are needed anymore around audio_get_buffer().

audiobuf and audiobufend are local to buffer.c now.

Closed by  Thomas Martitz
2011-08-15 12:52
Reason for closing:  Accepted
Additional comments about closing:  


Thomas Martitz commented on 2011-06-20 21:48

Updated patch.
*) Rebased to current svn
*) Few bug fixes.

Thomas Martitz commented on 2011-07-09 23:48

Sync to latest SVN.

Frank Gevaerts commented on 2011-07-29 21:35

This looks sane to me, with of course the caveat that I'm not an expert for most of the apps/ code

Thomas Martitz commented on 2011-08-01 15:02

Updated version with a few bug fixes. Intent to commit this.

Thomas Martitz commented on 2011-08-03 20:14

(Probably) final update of this patch. Just a resync to SVN.

Thomas Martitz commented on 2011-08-09 18:48

Another updated patch with minor fixes.


Available keyboard shortcuts


Task Details

Task Editing