Thomas Martitz
d1322b7159
GSoC/Buflib: 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.
Buffer init is moved up in the init chain and handles ipodvideo64mb internally.
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 mp3data.c and talk mess with the buffer.
mpeg.c now implements some buffer related functions of playback.h, especially
audio_get_buffer(), allowing to reduce #ifdef hell a tiny bit.
audiobuf and audiobufend are local to buffer.c now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30308 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 15:13:00 +00:00
Andree Buschmann
4359058c79
Fix the Xing header parser to have reliable gapless playback. Closes FS#12062.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29708 a1c6a512-1295-4272-9138-f99709370657
2011-04-13 05:51:03 +00:00
Andree Buschmann
e209002c13
Optimize memory consumption in the mp3data parser. The vbr-header parser will never need 1.800 byte of data. The maximum amount of data needed is 1/10 of this.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29610 a1c6a512-1295-4272-9138-f99709370657
2011-03-18 07:08:25 +00:00
Andree Buschmann
c59a086da6
Local implementation of read_uint32be() in mp3data.c needs a major correction.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29609 a1c6a512-1295-4272-9138-f99709370657
2011-03-17 18:13:14 +00:00
Andree Buschmann
742980f94c
Avoid magic numbers. Use the available defines to set up the bit mask to compare MPEG frame headers.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29607 a1c6a512-1295-4272-9138-f99709370657
2011-03-16 22:05:46 +00:00
Andree Buschmann
3706d6d0b5
Hopefully fix red now and reduce binsize for HWCODEC targets. This change implements a local read_uint32be() function within the mp3data parser.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29606 a1c6a512-1295-4272-9138-f99709370657
2011-03-16 21:57:16 +00:00
Andree Buschmann
25246f7e47
More robust implementation of MPEG frame header search. The parser will not only search for the very first byte sequence that looks like a valid MPEG frame header. It will search for a valid MPEG frame header sequence, decode it, and probe if there is a consecutive MPEG frame header of the same type (MPEG version, layer, sampling frequency) at the expected position. This approach will reduce false detection of MPEG frame headers in case of errorous metadata or garbaged files. Fixes FS#12007.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29603 a1c6a512-1295-4272-9138-f99709370657
2011-03-16 18:45:03 +00:00
Andree Buschmann
8aed244bd8
Add up skipped bytes when parsing for valid MPEG headers.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29583 a1c6a512-1295-4272-9138-f99709370657
2011-03-13 19:59:27 +00:00
Andree Buschmann
ff1b2b7fab
Refactor reading of Xing/Info/Vbri tags to prepare for further changes.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29582 a1c6a512-1295-4272-9138-f99709370657
2011-03-13 19:25:20 +00:00
Andree Buschmann
41658bd07a
Remove some useless code and variables in the area of metadata parsing. Bump codec API.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29438 a1c6a512-1295-4272-9138-f99709370657
2011-02-27 20:49:08 +00:00
Andree Buschmann
ae32e1ef06
Ensure proper initialization of some variables and arrays in metadata parsing. Fixes FS#11948.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29323 a1c6a512-1295-4272-9138-f99709370657
2011-02-17 18:35:24 +00:00
Thomas Martitz
48016d5e07
Reduce excessive debug output during mp3 parsing.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29191 a1c6a512-1295-4272-9138-f99709370657
2011-02-02 18:27:31 +00:00
Rafaël Carré
272e425a2f
get_mp3file_info(): Use the correct printf format in DEBUGF()
...
Also remove useless parens and casts in bytes2int()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28115 a1c6a512-1295-4272-9138-f99709370657
2010-09-19 08:27:49 +00:00
Rafaël Carré
9afa8002ae
get_mp3file_info(): remove unused variable
...
frames_per_entry is only used for debugging
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28109 a1c6a512-1295-4272-9138-f99709370657
2010-09-19 08:16:47 +00:00
Andree Buschmann
4d5e88245a
Remove more tabs
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24550 a1c6a512-1295-4272-9138-f99709370657
2010-02-07 18:38:47 +00:00
Magnus Holmgren
7f03af08fa
Quick fix to allow certain MP3 files to play. If a Xing or Info header didn't properly set both the frame count and byte count, then the bitrate was set to zero, preventing playback. Better to use the bitrate of the first audio frame in this case. (More sanity checking of the frame count should perhaps be done.)
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22611 a1c6a512-1295-4272-9138-f99709370657
2009-09-03 21:14:13 +00:00
Björn Stenberg
51b45d5602
Split id3.c/h into metadata.c/h and metadata/mp3.c. Updated all references. Moved mp3data.c/h from firmware to apps.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18814 a1c6a512-1295-4272-9138-f99709370657
2008-10-15 06:38:51 +00:00