Commit graph

78 commits

Author SHA1 Message Date
William Wilgus
b40dff510a cuesheet.c guard against invalid digits causing underflow on field ASAN
is digit checks for invalid fields but could possibly check field = -1

Change-Id: I5f6bc5047b1ec0bf122d360f8eb86e64a2784bef
2022-11-21 23:24:30 -05:00
William Wilgus
f6c719d7ec replace strlcpy with strmemccpy
replace applicable calls to strlcpy with calls to strmemccpy
which null terminates on truncation

in theory the strmemccpy calls should be slightly faster since they
don't traverse the rest of the source string on truncation
but I seriously doubt there is too much of that going on in the code base

Change-Id: Ia0251514e36a6242bbf3f03c5e0df123aba60ed2
2022-11-14 23:56:16 -05:00
William Wilgus
034b6d5bfb Remove some shadowed variables identified by -Wshadow
there are plenty more but these are the low hanging fruit

Change-Id: I86d9f4f56e8cd9b381d1bf6a6679cd58c6a4004d
2022-11-14 09:01:43 -05:00
Aidan MacDonald
e03bc66594 Correct typo DEFAULT_SKIP_TRESH -> DEFAULT_SKIP_THRESH
Change-Id: If8f7d11301a07a7f63adfac618f07cfed9516eef
2022-10-18 12:56:28 +01:00
Aidan MacDonald
d5a081cbd1 gui: Remove "enum list_wrap" from list action functions
Removing the "list_wrap" argument is actually pretty easy.
In practice, almost all lists are using LIST_WRAP_UNLESS_HELD
behavior so we can make that the default. A couple of lists
disable wraparound with LIST_WRAP_OFF; this is now achieved
by setting the list "wraparound" flag to false when setting
up the list. LIST_WRAP_ON was unused and is of questionable
value, so it has been removed entirely.

This makes list wraparound behavior a property of the list,
controlled solely by the "wraparound" flag. The result is a
simpler list API and implementation, without changing the
behavior of any lists.

Change-Id: Ib55d17519e6d92fc95ae17b84ab0aaf4233bcb5a
2022-10-05 11:22:55 -04:00
Nick Peskett
db55d30372 Allow cuesheet index offsets longer than 99 minutes.
While the track number is limited to 99, I know of no documented
constraint on the value of offset minutes to 99.

As we are storing the millisecond offset as unsigned long, assuming
32 bit, we can allow 70,000 minutes (2^32 / 60000).

However, I've been unable to generate a test audio file 48 days long
under 2GB, so I've set the limit to 30,000 minutes.

In addition, this change reduces the maximum number of seconds to 59,
and frames to 74.

I've generated some silent test files with the filenames being
cue_[minutes].mp3

http://peskett.co.uk/rockbox/test_cues/

Change-Id: I3ca4468ebc88ba134c4e785e9395f90bf76941ac
2022-04-07 20:10:19 -04:00
William Wilgus
b31444261e [COV] cuesheet.c var line could be uninitialized
Change-Id: Id753ecc28f4029e05032be0c0ac6ecd27e9e370f
2022-03-18 18:57:55 -04:00
William Wilgus
99f8457279 cuesheet, fix dumb typo
Change-Id: I17aefb0b507898819f9f6d369d986205c6a59c9d
2022-03-18 17:34:11 -04:00
William Wilgus
6d122e3932 cuesheet, cleanup tag code with strncmp
Change-Id: I97076266103d20e59537e4e0959a70cc12b207f6
2022-03-13 17:11:50 -04:00
Christian Soffke
1697b13693 whitespace fixes
Change-Id: I86880595b78e3cae62361c32ca57cf6f6a4ad963
2021-10-21 22:42:01 +02:00
William Wilgus
ea438ee132 cuesheet.c Fix potential NULL in INDEX parsing
untested

Change-Id: I6160348eeece364e3242f047437877ea34136f9c
2021-07-30 02:30:49 +00:00
Solomon Peachy
658026e626 [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice.
Note:  I left behind lcd_bitmap in features.txt, because removing it
would require considerable work in the manual and the translations.

Change-Id: Ia8ca7761f610d9332a0d22a7d189775fb15ec88a
2020-07-24 21:20:13 +00:00
Solomon Peachy
8cb555460f [3/4] Completely remove HWCODEC support
'swcodec' is now always set (and recording_swcodec for recording-capable
units) in feature.txt so the manual and language strings don't need to
all be fixed up.

Change-Id: Ib2c9d5d157af8d33653e2d4b4a12881b9aa6ddb0
2020-07-24 21:20:13 +00:00
William Wilgus
6bfd7da97c Fix Truncation warning in cuesheet.c->browse_cuesheet
give user concrete indication that track title has been truncated
by adding '~' at end of string

Change-Id: I53034f4a09c103eb98ae1e0ef0a8a843fd2a2c6e
2018-12-08 04:47:27 -06:00
William Wilgus
7bec71368b Fix formatting cuesheet.c
Change-Id: I51edd5319882b2928b565c27615e20937399a1f9
2018-07-25 19:32:25 +02:00
William Wilgus
2eeb338e90 Ignore cuesheet title truncation
Change-Id: I0de8a1468379f60140fb30b6c086fe15ea753da2
2018-07-25 14:14:45 +02:00
William Wilgus
bdbc7f7b7b Revert "Remove truncation from cuesheet"
This reverts commit a81c63160c.

Change-Id: Ie6d3e780fd6318b6173943167015f78f4a9c327a
2018-07-25 08:33:14 +02:00
William Wilgus
021124f868 Revert "Fix cuesheet printf truncation"
This reverts commit c332180afd.

Change-Id: Ic7a85a0fe82cd13514e85011e0a5cbd79ec36c2b
2018-07-25 08:31:13 +02:00
William Wilgus
c332180afd Fix cuesheet printf truncation
Change-Id: I48189c3ce29f27d4b3bb4f874c80636c1f0ca6b6
2018-07-25 08:13:19 +02:00
William Wilgus
a81c63160c Remove truncation from cuesheet
Lets see if this works..

Change-Id: I1fa7f17a07b3a7b479f987694ffcd59bc4e0bf5b
2018-07-25 07:33:13 +02:00
Michael Sevakis
5ee13ebd39 Implements starting playback from a cuesheet.
Before time-based resume this was impossible since playback could not
be started at a specified elapsed time, only seeked with playback already
running.

Right now the "FILE" field is used, if present, to do the lookup from
from the .cue to the audio file when it is separate from the audio file.
If no path is specified, the .cue and audio file must be in the same
directory.

When the cuesheet is embedded, the containing file is used and the FILE
field is ignored.

Supports starting playback and seeking to cue points from the cuesheet
browser even without Cuesheet Support turned on.

Change-Id: Ib5b534c406f179a7f8c7042a31572b24a62c0731
Reviewed-on: http://gerrit.rockbox.org/522
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested: Michael Sevakis <jethead71@rockbox.org>
2014-03-10 04:13:53 +01:00
Thomas Martitz
2a471c9e84 cuesheet: Fix another possible buffer overflow with long filenames.
Change-Id: I9d8fa8fcb0a872f688664c53881fde93f2de9436
2014-01-11 18:24:48 +01:00
Thomas Martitz
fe08ac4c2f cuesheet: Fix possible buffer overflow with long filenames.
Change-Id: I49fe6da35057895d3c5a08a8723afe41eef7afe8
2014-01-11 18:01:22 +01:00
Konstantin Kudakov
8c286b4686 cuesheet: Search for /path/to/music.mp3.cue as well if all fails.
Change-Id: If58ea7c7b94de54f6d9b014f069807bb88c6a147
2014-01-11 16:29:00 +01:00
Alexander Levin
7f7a2d3b13 Rename 'mp3entry.embed_cuesheet' to 'mp3entry.embedded_cuesheet' and pull out a field (FS#12473)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31406 a1c6a512-1295-4272-9138-f99709370657
2011-12-22 18:56:11 +00:00
Nick Peskett
1b781df59c Convert hard-coded unicode byte order mark values to constants.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31374 a1c6a512-1295-4272-9138-f99709370657
2011-12-20 08:15:36 +00:00
Nick Peskett
02fd314a0b FS #12419 : Support for embedded cuesheets.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31321 a1c6a512-1295-4272-9138-f99709370657
2011-12-16 10:09:41 +00:00
Andree Buschmann
ae2233b338 Change the cuesheet fix from r30359 to have a minor binsize increase on SH1.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30362 a1c6a512-1295-4272-9138-f99709370657
2011-08-26 16:46:23 +00:00
Andree Buschmann
9931b3c7a8 Avoid overflow in cuesheet marker positioning. Fixes FS#12246. Thanks to Nick Peskett.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30359 a1c6a512-1295-4272-9138-f99709370657
2011-08-26 15:52:22 +00:00
Jonathan Gordon
e63e19b507 Fix Database red, move the cuesheet->token code into the skin engine
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27616 a1c6a512-1295-4272-9138-f99709370657
2010-07-29 13:23:33 +00:00
Jonathan Gordon
2d31d77a8b FS#11470 - new skin code, finally svn uses the new parser from the theme editor. This means that a skin that passes the editor WILL pass svn and checkwps (unless the target runs out of skin buffer or something.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27613 a1c6a512-1295-4272-9138-f99709370657
2010-07-29 12:37:48 +00:00
Jonathan Gordon
b8d98fcc19 Change cuesheet handling so the id3 info is not spoofed anymore. If something wants the subtracks info it is easy to get to. This makes next track display in the skins show the next subtrack if we are in a cuesheet
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26611 a1c6a512-1295-4272-9138-f99709370657
2010-06-06 06:28:40 +00:00
Thomas Martitz
50a6ca39ad Move c/h files implementing/defining standard library stuff into a new libc directory, also standard'ify some parts of the code base (almost entirely #include fixes).
This is to a) to cleanup firmware/common and firmware/include a bit, but also b) for Rockbox as an application which should use the host system's c library and headers, separating makes it easy to exclude our files from the build.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25850 a1c6a512-1295-4272-9138-f99709370657
2010-05-06 21:04:40 +00:00
Teruaki Kawashima
f50885534e Pass width instead of x+width to ab_draw_markers()/cue_draw_markers() and don't recalculate the width in these functions.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25053 a1c6a512-1295-4272-9138-f99709370657
2010-03-07 12:51:23 +00:00
Michael Chicoine
8e8e2627b2 FS#10856 - Skip to previous track inconsistent when using cuesheet
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24191 a1c6a512-1295-4272-9138-f99709370657
2010-01-06 14:48:42 +00:00
Jeffrey Goode
59dd433ccd Removed unneeded includes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23578 a1c6a512-1295-4272-9138-f99709370657
2009-11-09 05:46:08 +00:00
Nils Wallménius
3200d04d75 Make the formatter functions used by the settings return a pointer to avoid usless copying of lang strings, this brought with it a long chain of const correctness and a few random cleanups
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22440 a1c6a512-1295-4272-9138-f99709370657
2009-08-20 16:47:44 +00:00
Jonathan Gordon
eb0061411d more cuesheet cleanup. pass the cuesheet into cue functions so they dont have to call audio_current_track()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22020 a1c6a512-1295-4272-9138-f99709370657
2009-07-24 01:13:30 +00:00
Jonathan Gordon
24b136f62d rework cuesheet support:
swcodec: search for a .cue during buffering (with the possibility of adding embedded cuesheets later)
hwcodec: search for a .cue when the id3 info for the current track is requested for the first time (disk should be spining so non issue)

major beenfit from this is simplofy cuesheet handling code a bit... if mp3entry.cuesheet != NULL then there is a valid cuesheet.. no need to worry about if its enabled and preloaded.
There is the possibility of putting the next/prev subtrack handling inside the playback code (as well as the id3 updating stuff (see FS#9789 for more info), but thats probably not a good idea.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21978 a1c6a512-1295-4272-9138-f99709370657
2009-07-20 05:18:18 +00:00
Nils Wallménius
3d4701a6e4 FS#10080
* Move strncpy() from core to the pluginlib
* Introduce strlcpy() and use that instead in most places (use memcpy in a few) in core and some plugins
* Drop strncpy() from the codec api as no codec used it
* Bump codec and plugin api versions


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21863 a1c6a512-1295-4272-9138-f99709370657
2009-07-14 13:57:45 +00:00
Bertrik Sikken
30a2713b6e Clean up some more #includes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20243 a1c6a512-1295-4272-9138-f99709370657
2009-03-08 18:37:32 +00:00
Nils Wallménius
5a55772201 Small code reuse improvement
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19943 a1c6a512-1295-4272-9138-f99709370657
2009-02-08 11:09:55 +00:00
Bertrik Sikken
91948d12aa FS#9638 - temp_cue is unused and wasting memory.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19890 a1c6a512-1295-4272-9138-f99709370657
2009-01-31 19:41:29 +00:00
Jonathan Gordon
3c1dbb269f Fix FS#9830 - utf8 encoded .cue files dont get displayed properly
Also fix a possible problem where the performer and songwriter tags could get cut off


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19858 a1c6a512-1295-4272-9138-f99709370657
2009-01-26 11:24:11 +00:00
Nils Wallménius
93a87685c3 Clean up use of snprintf where strncpy if suited, avoid useless copying of constant strings for wps token evaluator, minor const police too.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18625 a1c6a512-1295-4272-9138-f99709370657
2008-09-24 20:03:53 +00:00
Dominik Riebeling
02103a2fa7 Unify opening of utf-8 files (FS#6203). This also adds ignoring the BOM in several places it has been missing (as FS#6071).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18185 a1c6a512-1295-4272-9138-f99709370657
2008-08-02 20:39:03 +00:00
Daniel Stenberg
2acc0ac542 Updated our source code header to explicitly mention that we are GPL v2 or
later. We still need to hunt down snippets used that are not. 1324 modified
files...
http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-06-28 18:10:04 +00:00
Bertrik Sikken
2843469876 Moved atoi declaration to stdlib.h. Deleted atoi.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17280 a1c6a512-1295-4272-9138-f99709370657
2008-04-28 16:18:04 +00:00
Nils Wallménius
a01996436d Use file_exists and dir_exists functions where appropriate, fix one wrong file descriptor check and one possible dir descriptor leak
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17147 a1c6a512-1295-4272-9138-f99709370657
2008-04-16 19:51:43 +00:00
Nils Wallménius
6848961aa5 Pass the buffer length to the list_get_name callback functions instead of using hardcoded MAX_PATH
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17049 a1c6a512-1295-4272-9138-f99709370657
2008-04-09 15:25:17 +00:00