Revert "buffering: remove bufgettail/bufcuttail"

This reverts commit 9e93796407.

Fixes FS#13626, which is caused by non-audio ID3v1/APE tags at
the end of the audio data stream.

Change-Id: Ic69af14a5d1264b7896a54b5f2ad314022dd98ac
This commit is contained in:
Solomon Peachy 2025-05-20 07:33:10 -04:00
parent 3cb4e63253
commit 2bd88936f7
5 changed files with 107 additions and 2 deletions

View file

@ -46,7 +46,8 @@ enum data_type {
#define ERR_FILE_ERROR -4
#define ERR_HANDLE_NOT_DONE -5
#define ERR_UNSUPPORTED_TYPE -6
#define ERR_BITMAP_TOO_LARGE -7
#define ERR_WRONG_THREAD -7
#define ERR_BITMAP_TOO_LARGE -8
/* Initialise the buffering subsystem */
void buffering_init(void) INIT_ATTR;
@ -67,6 +68,8 @@ bool buffering_reset(char *buf, size_t buflen);
* bufftell : Return the handle's file read position
* bufread : Copy data from a handle to a buffer
* bufgetdata: Obtain a pointer for linear access to a "size" amount of data
* bufgettail: Out-of-band get the last size bytes of a handle.
* bufcuttail: Out-of-band remove the trailing 'size' bytes of a handle.
*
* NOTE: bufread and bufgetdata will block the caller until the requested
* amount of data is ready (unless EOF is reached).
@ -82,6 +85,8 @@ int bufadvance(int handle_id, off_t offset);
off_t bufftell(int handle_id);
ssize_t bufread(int handle_id, size_t size, void *dest);
ssize_t bufgetdata(int handle_id, size_t size, void **data);
ssize_t bufgettail(int handle_id, size_t size, void **data);
ssize_t bufcuttail(int handle_id, size_t size);
/***************************************************************************
* SECONDARY FUNCTIONS