Commit graph

36287 commits

Author SHA1 Message Date
Aidan MacDonald
2f71571c0a Fix faulty Play Shuffled behavior (FS#13347)
When replacing a dynamic playlist with Play Shuffled, the current
track could incorrectly be left at the end of the new playlist.
Fix this - the current track should always be at the beginning,
so it can be skipped past regardless of the repeat/shuffle mode.

Change-Id: Ia86539bc23ad8ebd714b8dc50b5720671b4ad0a9
2022-05-15 15:23:36 +01:00
Aidan MacDonald
2315266628 kernel: remove unused function mutex_test()
No longer needed since the only user was in the Archos code.

Change-Id: I763f58050c70f2bb1d8cc0a044c63698f3157a8d
2022-05-14 11:29:55 -04:00
Aidan MacDonald
dafc8e5904 kernel: remove unused kernel/pthread/*.c files
These don't seem usable and it looks like the files were added by
accident by d66346789c "buflib: Check the validity of of handles
passed to buflib_get_data() in DEBUG builds."

Change-Id: I4d4601f1fef7901c08ae86448853d008f48d5f43
2022-05-14 11:29:55 -04:00
Aidan MacDonald
d20071def0 apps: Add "keep current track when replacing playlist" setting
Add a setting that makes Play and Play Shuffled in the playlist
context menu leave the current song (if any) playing when they
replace the playlist. Default to on, since this was the behavior
of the old "Clear List & Play Next" option.

Change-Id: I1340aed5c28bb3244e36d0953b3308ae59681c97
2022-05-14 16:05:46 +01:00
Aidan MacDonald
70087fb9f3 apps: Change playlist context menu behavior, fix FS#13336
Rename the "Clear List & Play" options to simply Play and Play
Shuffled, and change their behavior slightly. Previously they
would leave the current song playing, but now they will start
playing the first song of the new playlist immediately.

Shuffle options are now consistently hidden whenever a single
file is selected.

Fixes FS#13336 -- Play Shuffled is now always displayed where
applicable, regardless of playback state.

Change-Id: Idd454b4f9ab2c98cda3ce0389add747a3273fb42
2022-05-14 16:05:45 +01:00
Solomon Peachy
7363d65f10 manual: Fix up some issues to try and get texlive2021 working ok.
Change-Id: I6fd5cfd7f27792cffbd061d96fdc8c852cc85050
2022-05-09 10:36:42 -04:00
Christian Soffke
f3358eb20a Properties plugin: Eliminate redundant Track Info code
When opening an audio file from the file
browser or database using the Properties
plugin, it will now use existing code from
the Show Track Info screen for displaying
metadata. The menu option has been
renamed accordingly.

Change-Id: I5a824865b9f980151b91aff3c3c18ec45830a12c
2022-05-09 09:44:23 -04:00
Aidan MacDonald
4b293285ea pictureflow: fix album index alignment in load_album_index
Change-Id: I7c3c86ffdab62859ce88faeeb84160ea52a4626a
2022-05-07 16:28:27 +01:00
Aidan MacDonald
f661dc596e pictureflow: fix bug in calculation of album art buf size
I intended to check for enough space in buffer but this isn't
really doing it and it is making aa_bufsz slightly too big so
it's a possible buffer overflow.

Restore the old ALIGN_DOWN(..., 4) rounding in case it's important,
if not, then no harm done.

Change-Id: I904f255ac79a77d5328b44667502ceae8308e659
2022-05-07 15:52:26 +01:00
William Wilgus
2c4480979f tdspeed.c remove buffer name strings
get rid of the magic buffer size and the whole name buffer
naming the buffers individually doesn't serve any real purpose
instead add a static string for all td buffers

Change-Id: I962a966456453e1b84bab6fec6f4df7cb075ef4e
2022-05-05 00:31:07 -04:00
William Wilgus
09ef94ed8b add const to const * strings iriver Fix Red
the iriver devices overwrite the pointer

Change-Id: I20ae6db2aec0f957824b61db349c7c45a95e58d9
2022-05-03 23:58:00 -04:00
William Wilgus
79864c6ec2 add const to const * strings
I don't think this will amke any difference except maybe for hosted ports

Change-Id: I84f898aea92a6963901a6d889dd18b63f24c9a41
2022-05-03 23:00:58 -04:00
Aidan MacDonald
4dd3c2b33e codecs: m4a: improve seek accuracy
Seeking doesn't work well in M4A files with very few chunks due to
the seek method used (chunk based using the info in the 'stco' atom).
According to libm4a/demux.c the expected seek resolution using this
method is 1/4 to 1/2 seconds. However, ffmpeg generates files with a
1 megabyte chunk size, so the resolution is much worse than expected
on some files: around 30-40 seconds at 256kbps.

There was a bug with the seek position reported back to Rockbox: the
codec pretended it could seek exactly to the requested sample, but it
would only seek to the start of a chunk. This could leave the UI in a
confusing state because the real playback position was different from
what the elapsed time showed. Fix this by recalculating the reported
sample position using the chunk start.

To fix the low seek accuracy, use the table in the 'stsz' atom to skip
individual packets within a chunk. This is very accurate, but it takes
a lot of RAM to allocate the table. Currently the table is not allowed
to use more than half of the codec RAM, which should suffice for short
files on most targets. On files where the table is too large the codec
will fall back to the less accurate chunk-based seek method.

Change-Id: Ide38ea846c1cdd69691e9b1e1cd87eb0fa11cf78
2022-05-02 12:16:21 -04:00
Aidan MacDonald
b79eefc858 apps: fix tagtree arithmetic on null pointers
It was possible for the tag tree's buflib move callback to turn a
null pointer non-null. The tagcache_search_clause->str can be null
for OR clauses. Also ensure that clauses are zeroed on allocation
to ensure garbage pointers don't creep in.

Change-Id: Ic823a8eecc501eeaa75798066521e427a9a89190
2022-05-02 16:48:19 +01:00
Aidan MacDonald
6e37b31851 apps: fix use of negative fd in open_plugin.c
Bug reported by UBSan.

Change-Id: I3223a496dfa5df4e3df97fb88a14ea0174d4b428
2022-05-02 16:42:32 +01:00
Aidan MacDonald
dadfbfc6a5 apps: fix close of negative fd in talk.c
Bug reported by UBSan.

Change-Id: I02276521510acac8696499895fec15993c55aaf6
2022-05-02 16:34:18 +01:00
Aidan MacDonald
e5e457b526 apps: fix int/long mismatch in playlist.c
A couple of places use sizeof(int) for allocations and copying but
the indices are longs, which causes bugs in the simulator on 64-bit.

Change-Id: Ie101ac57d44217c4b1657cf0152c97e276bd7043
2022-05-02 16:10:15 +01:00
Aidan MacDonald
6b8c94a6e3 Fix some non-portable alignment values
UBSan reports an avalanche of unaligned pointer bugs stemming from
hardcoded 4-byte alignments used in certain places. Use sizeof(long)
instead to align to the machine word size.

Change-Id: I28e505212462c5268afa24e95df3a103ac3e2213
2022-05-02 15:38:48 +01:00
Aidan MacDonald
366f00a3d3 plugins: fix out of bounds read in chopper
GCC complains about this when compiling with UBSan.

Change-Id: I4bd8ff2b47882ab95620dc7750a9a80f823cc2ea
2022-05-02 15:38:48 +01:00
William Wilgus
ab71b9e334 tree.c update settings when new theme selected
Change-Id: I376aba4258dd3c54c45d97317aa1e7bc8f2a3a17
2022-04-28 18:56:13 -04:00
William Wilgus
f0d3a62d91 keyboard.c change math for editline above picker
Change-Id: I59e7f7face07f3f97fc6e016ee333cd3139ad5fd
2022-04-27 21:40:49 -04:00
Aidan MacDonald
9e93796407 buffering: remove bufgettail/bufcuttail
These operations can only be used in limited circumstances and have
exactly one user. bufgettail especially seems of dubious value; how
often do you need to read N bytes from the end of a file without
changing the file position?

strip_tags() was the only function using them, to strip off ID3v1
and APE tags off the end of buffered tracks. This would save only
32-192 bytes per track -- if the container format uses APE/ID3v1.
It hardly seems worth the effort.

Change-Id: I8fc3c1408517eda6126e75e76d76daea904b50eb
2022-04-20 16:51:49 -04:00
Dana Conrad
931d616071 Manual: Add Eros Q Native Bootloader download link
Forgot this in the previous patchset

Change-Id: I3f58e31e57e90cf3bc5f4b02a37ac4c99e8e52b4
2022-04-19 21:27:57 -05:00
William Wilgus
002575dbcf [BUGFIX] gui_synclist move global display settings to list struct
forgot to add the update function to the list_wraparound callback

Change-Id: I7ee7940f126726c727344d7d09371f1bf3295c81
2022-04-18 23:08:04 -04:00
Christian Soffke
1c3f6e063a fiiom3k Yes/No screen: Only accept Play button for YES
According to the on screen instructions, any other button
should mean No.

More importantly, in my experience at least, the Select
"button", since it is touch-activated, can sometimes be
pressed by accident, especially when a warning screen
is displayed as a result of pressing that same button.

Change-Id: Ieeadfa8018b5df99605297bc47948a181c22dab4
2022-04-18 22:28:13 -04:00
Dominik Riebeling
f8d54d0d1e rbutil: Bump to 1.5.1.
Change-Id: Idfc846ee1922271a709a097989c7a9a31e9d7279
2022-04-18 21:02:12 +02:00
Dominik Riebeling
3ed515872c rbutil: Fix progress dialog abort changed too early.
Don't change the abort button to Ok after a successful bootloader
install, this will be done by the following steps.

Change-Id: I4275de1f44bddf0580b10b36240a36a43daa68d0
2022-04-18 19:35:36 +02:00
Dominik Riebeling
80ac6893c0 rbutil: Update changelog.
Change-Id: I0d3ad4cba8cc5393d86cf2b96fc755ad6ec90b01
2022-04-18 19:35:36 +02:00
Dominik Riebeling
e4cb1615f4 rbutil: run lupdate on all translations.
Change-Id: I676cddf93724e07790cd393b697c127928f3949b
2022-04-18 19:35:36 +02:00
Dominik Riebeling
e2dc0a2c07 rbutil: Make zip install log less noisy.
No need to show a separate entry when a cached file has been used, do it
the same way as bootloader downloads do.

Change-Id: I42a21a37474a778975e82af0102e0152677a0343
2022-04-18 19:35:35 +02:00
Dominik Riebeling
1155851ffb rbutil: Make "Info" tab more responsive.
Loading the information can take a bit depending on the speed of the
disk. To make the application not appear as frozen update the UI more
often, and display a "Loading" text during data retrieval.

Change-Id: I012487d031ea71e62b583ca1c40220ea709e7034
2022-04-18 19:35:35 +02:00
Christian Soffke
e71a441762 ImageViewer: Fix buffer overflow
np_file is a buffer of size MAX_PATH. After
removing only the file name component and
leaving the rest of the path, the
available space may not be sufficient
for appending another file name (possibly of
size MAX_PATH itself) to it.

This can occur after a file of acceptable
length is opened in ImageViewer, and you
then advance to another file whose path
(including the file name) is longer than
MAX_PATH.

Change-Id: Ideadd9451359bd5735bce92fca5d983e61f300e9
2022-04-18 10:58:40 -04:00
Christian Soffke
1c66e97522 Database: Remove File View menu
These options don't seem to
apply to the database...

Change-Id: I777073eeaed4099acf44996b95fa05b4c2b3abc4
2022-04-18 10:48:41 -04:00
Aidan MacDonald
a234df30df Fix sim build for glibc >=2.34
Change-Id: If63787514b6bffc0afb71f9d651f8c6f0c328a2d
2022-04-18 09:54:07 -04:00
Christian Soffke
4d7327b04d Album Art: Eliminate redundant check
When the 'Album Art' setting was set to
'Prefer Image File' and neither image file
nor embedded artwork were found,
playback would check for files twice.

Change-Id: Ibe392928d58ec04103e2572124841724509bd859
2022-04-18 09:13:31 -04:00
Dana Conrad
b02123d349 Manual: Add Eros Q Native
Here is the PDF this patchset produces: https://www.dropbox.com/s/v1uz8p2fsgsz1ng/rockbox-erosqnative-923dabb5cd-220409.pdf?dl=0

Change-Id: I27554cb65a6498a6ccb714d4f93f25264b516e99
2022-04-18 09:09:03 -04:00
Bernd Busse
dc67d821c3 toolchain: update zlib to 1.2.12 for native mips targets
zlib has been updated to 1.2.12 on March 27, 2022 with the following note:

    Due to the bug fixes, any installations of 1.2.11 should be
    replaced with 1.2.12.

The previous version has been removed and is no longer available for
download on the official site.

Change-Id: I807fbb4605378d99654be3e4c1b28bd04de729c9
2022-04-18 09:07:39 -04:00
Dominik Riebeling
fc38cd8215 rbutil: Fix uninstall not updating install log.
Change-Id: Icd71f1a2de73d23c6580523de8c810b5a10a194b
2022-04-17 23:21:19 +02:00
Dominik Riebeling
37a60d5461 rbutil: Enable themes install depending on theme selection.
Don't store the "Install Themes" option. Automatically enable themes
installation if the themes selection has at least one entry selected
instead.

Change-Id: Ib46e8b53b0204555b79dea51545dd7c380f003ff
2022-04-17 23:21:19 +02:00
Dominik Riebeling
62108a9613 rbutil: Use references to avoid creating temporary objects.
Get rid of some unnecessary object creating / copying by using
references.

Change-Id: Ia44e34f6f66d230caa9af7ef7c0eca73be12de2a
2022-04-17 23:21:19 +02:00
Dominik Riebeling
8c55ce62b9 rbutil: Move bootloader file check to base class.
Avoid constructing the bootloader file path in the caller. Pass filename
list and mountpoint separately so it can directly fall back to the
mountpoint.

Change some functions to use references instead of creating temporary
objects.

Change-Id: I09c9d755553a32de3d02a42a8ce1fcb94f831b2a
2022-04-17 23:21:19 +02:00
Aidan MacDonald
1af92e5ff8 Fix red from 6f5af8e53c
Change-Id: I02dbc3e91856eaef081446ca77919e6182a85e1d
2022-04-17 17:21:02 +01:00
Aidan MacDonald
fca7b8e2ff Fix undefined behavior that blocks compiling with UBSan
Left shifts are not defined in C if they would cause signed overflow,
so these expressions get instrumented, which makes them unusable as
switch values and triggers compile errors when compiling with UBSan.

Change-Id: I0588d4be1e00ba1cfde0eac119ead368b20d10c9
2022-04-17 11:37:34 -04:00
Aidan MacDonald
c6df8cc4f7 configure: Add support for compiling the simulator with UBSan
By passing --with-ubsan to tools/configure, you can now build the
simulator with UBSan to catch undefined behavior at runtime.

Change-Id: I054cd46ca59587dd544efbd7bdf6d27a040a4891
2022-04-17 11:37:34 -04:00
Christian Soffke
6f5af8e53c Add Codec to Track Info screen
Change-Id: Ieec0e49d0b5e1ca14fa828a510edf30d548969b2
2022-04-17 11:32:13 -04:00
William Wilgus
c4156b1909 viewports, set flags to VP_DEFAULT_FLAGS
flags were getting un-initialized memory
it really didn't matter with the flags getting initialized
anyway
But once I added a new flag that didn't explicitly
set or clear the flag at init well here we are

set flags to VP_DEFAULT_FLAGS in viewport_set_defaults()

add the flags variable to the default vp's set to 0
(it was already initialized to 0 by bss, make it explicit)

Change-Id: I3a9a062455b4cf66d2b8c70fdf05402a5c0c091c
2022-04-17 10:59:56 -04:00
Christian Soffke
6703f43f5c Playlist Viewer: Always retrieve track Info from disk
Frequency, file size, and the codec are not stored
in the database and thus can’t be displayed in the
Playlist Viewer's Track Info screen when metadata
is only retrieved from the database.

Change-Id: I9e1d11c13ad8bf7b90b654ed78e4e7f763c30f8a
2022-04-17 10:58:42 -04:00
Aidan MacDonald
0e8f3669d0 Fix remaining red from 3fcdadce24
Change-Id: I619a637bdf1fb932c3618f1f40aaa1c9e7f98300
2022-04-16 16:06:13 +01:00
Aidan MacDonald
76035decc6 Fix red in 3fcdadce24
Change-Id: Idbee52505b3c109a0aad23e2edf7dd78519eb173
2022-04-16 10:41:19 -04:00
Christian Soffke
f989339664 Remove dead code
Change-Id: If31a99e6488dabab47d482637b2609ff829df1ca
2022-04-16 10:18:28 -04:00