Commit graph

208 commits

Author SHA1 Message Date
Thomas Martitz
e063725534 Dircache: Return the size of the result string in dircache_copy_path() so that callers don't need to call strlen on it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30034 a1c6a512-1295-4272-9138-f99709370657
2011-06-20 20:12:15 +00:00
Miika Pekkarinen
f2ef42c1da Fixed a changelog export/import problem with tagcache where <CR> or <LF>
characters in a tag could cause the parser fail to import a track
statistics correctly. Now line feeds are escaped properly and carriage
returns ignored on import.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30021 a1c6a512-1295-4272-9138-f99709370657
2011-06-20 15:53:33 +00:00
Miika Pekkarinen
8d9b9d247b Removed redundant copy of tagcache master_header structure stored in
memory. One of these headers (current_tcmh) was not loaded in when
tagcache state was initialized from a hibernated state file (flashed
H1xx targets). That caused internal serial number to start always from
zero, rendering "recently played tracks" query not working as expected.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30016 a1c6a512-1295-4272-9138-f99709370657
2011-06-19 14:36:26 +00:00
Michael Hohmuth
f9f96325e2 FS#12107: Remove track-number guessing code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29982 a1c6a512-1295-4272-9138-f99709370657
2011-06-06 23:03:31 +00:00
Michael Hohmuth
6a0021cf20 FS#12132 patch 5: check_clauses: Optimizations.
* There's no need to reset the buffer argument to
  check_against_clauses to 0 when it's not needed.  We can always
  initialize str = buf and only change it on a RAM search hit.

* Do not memset buffer to 0 -- it's sufficient to make sure the
  retrieved tag string is zero-terminated.

* Factor out a call to check_virtual_tags from two branches of an if
  statement.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29981 a1c6a512-1295-4272-9138-f99709370657
2011-06-06 22:49:07 +00:00
Michael Hohmuth
564a8ed1fd FS#12132 patch 3: Rename read_numeric_tag to find_tag, as it is indeed
used for nonnumeric tags as well.

Optimization for the nonnumeric case: Only numerics are ever updated,
so there's no need to scan the command queue for updates to nonnumeric
tags.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29979 a1c6a512-1295-4272-9138-f99709370657
2011-06-06 22:48:57 +00:00
Michael Hohmuth
509d6a901d FS#12132 patch 2: add_uniqbuf: Fix confusing indentation in if condition
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29978 a1c6a512-1295-4272-9138-f99709370657
2011-06-06 22:48:53 +00:00
Michael Hohmuth
bc315ad731 FS#12076 - DB stats resurrection: If the filename was changed, require
all three of album, artist, and title tags to match for resurrection
to take place.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29858 a1c6a512-1295-4272-9138-f99709370657
2011-05-11 22:37:46 +00:00
Michael Hohmuth
6a24a7a903 tagnavi.config: Add a logical-OR operator ("|") for tagnavi conditionals.
Logical-AND ("&") always takes precedence over logical-OR.
(Parentheses are not supported.)

Fight binsize increase by storing some common expressions in local
variables. This avoids repeated reevaluations involving memory
accesses.

check_clauses: Fail clause (return false) in case of errors (tag too
long, DB entry deleted).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29851 a1c6a512-1295-4272-9138-f99709370657
2011-05-10 10:25:41 +00:00
Andree Buschmann
f19d6a5e1d Fix even more 'variable set but not used' warnings reported from GCC 4.6.0.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29819 a1c6a512-1295-4272-9138-f99709370657
2011-05-03 20:28:56 +00:00
Michael Hohmuth
cf223b98ad Do not attempt to remove the temporary database twice during a database update.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29716 a1c6a512-1295-4272-9138-f99709370657
2011-04-15 21:45:45 +00:00
Fred Bauer
71e4b03ed6 Follow symlink dirs on UI simulator
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29530 a1c6a512-1295-4272-9138-f99709370657
2011-03-05 23:19:06 +00:00
Michael Hohmuth
b016ab9d86 DB import: Correctly import previously exported resume offsets
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29469 a1c6a512-1295-4272-9138-f99709370657
2011-02-28 23:47:11 +00:00
Michael Hohmuth
1a23e0ca19 Fix database import and export
Correct an omission that happened when the DB schema was changed last
time.  Add a comment to enum tag_type to prevent this from happening
in the future.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29435 a1c6a512-1295-4272-9138-f99709370657
2011-02-27 20:25:11 +00:00
Thomas Jarosch
29e4a2d90d Fix buffer size used for realpath() call
Thanks to kugel for pointing this out.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29320 a1c6a512-1295-4272-9138-f99709370657
2011-02-16 18:40:44 +00:00
Thomas Jarosch
1dbea9d959 No need to cast away const. Thanks to sideral
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29318 a1c6a512-1295-4272-9138-f99709370657
2011-02-16 17:58:57 +00:00
Thomas Jarosch
0060fed451 RaaA: Fix tagcache filename lookups for paths containing symbolic links
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29317 a1c6a512-1295-4272-9138-f99709370657
2011-02-16 01:01:49 +00:00
Michael Sevakis
b15aa47c56 All kernel objects in code shared amongs targets (core, plugins, codecs) should be declared SHAREDBSS_ATTR as any core could potentially touch them even though they seem only to involve threads on one core. The exception is target code for particular CPUs where proper allocation is fixed. playlist.c was a little odd too-- use one mutex for the current playlist and a separate one for created playlists (still pondering the necessity of more than one).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29305 a1c6a512-1295-4272-9138-f99709370657
2011-02-14 11:27:45 +00:00
Thomas Martitz
4aec8ef059 Fix SDL app build
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29159 a1c6a512-1295-4272-9138-f99709370657
2011-01-29 01:26:43 +00:00
Thomas Martitz
b703d251be Workaround the brokenness of realpath() a bit more.
At least on android it blindly writes to the end of the buffer passed to it assuming it's sufficiently. It wasn't in our case, resulting in a buffer overflow (and breakage).
This should fix strange problems relating to database initialization on application targets.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29147 a1c6a512-1295-4272-9138-f99709370657
2011-01-27 20:17:55 +00:00
Dominik Riebeling
d2cc5ce58e Fix player becoming unresponsive on Stop / Pause in some cases.
Fix for FS#11856: In tagtree_buffer_event, do not wait for database to
come online as that may never happen.  Rather, wait until it either
has come online or has decided that this will never happen.  Added a
new function to tagcache.c to export this information.

Flyspray: FS#11865
Author: Michael Hohmuth


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29081 a1c6a512-1295-4272-9138-f99709370657
2011-01-17 22:28:36 +00:00
Michael Giacomelli
cacc64a4fe Blind commit a 'fix' for automatic resume on HWCODEC since I don't understand HWCODEC and have no way to test builds for it. For now just disable it. In the long term it would be nice to support this on HWCODEC, or failing that, clean this up a little more.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28943 a1c6a512-1295-4272-9138-f99709370657
2011-01-02 03:48:40 +00:00
Michael Giacomelli
66e8fc0f0d Commit part of FS#11748 by Michael Hohmuth. Adds support for automatically resuming any song that is not played to completion at any point later in time, regardless of how many intermediate tracks are played. This is accomplished by expanding the database to record incompletely played tracks. Currently, the feature is simply on or off, in which case all tracks automatically resume, or they do not. The remainder of patches in the task expand this feature by allowing only certain file to automatically resume, only resuming in certain circumstances, etc but are not included until we reach agreement on what should be included. Additionally, the manual will need to be updated once we agree on the available settings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28942 a1c6a512-1295-4272-9138-f99709370657
2011-01-02 02:49:13 +00:00
Thomas Martitz
87c8be4a08 RaaA: Improve tagcache search to make the database built.
First, it add the ability to tagcache to walk through multiple search roots.
Second, it adds symlinks targets to the search roots if they're are not inside any of the current search roots, otherwise the symlink is ignored (unless it's a file).

The default search root is still /, so no search root will be actually added.
But the tagcache now isn't trapped by recursive symlinks anymore and successfully builds, and it's prepared for a future music directory setting.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28884 a1c6a512-1295-4272-9138-f99709370657
2010-12-23 19:02:18 +00:00
Alexander Levin
871af160f3 Fix a typo in a comment
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28777 a1c6a512-1295-4272-9138-f99709370657
2010-12-08 22:08:08 +00:00
Thomas Martitz
2c2416094f Get rid of get_user_file_path and do the path handling in wrappers for open() and friends.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28752 a1c6a512-1295-4272-9138-f99709370657
2010-12-06 22:26:31 +00:00
Jonathan Gordon
efba7d8c30 once more
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28647 a1c6a512-1295-4272-9138-f99709370657
2010-11-23 00:27:54 +00:00
Jonathan Gordon
1e0006b008 fix red
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28646 a1c6a512-1295-4272-9138-f99709370657
2010-11-23 00:25:48 +00:00
Jonathan Gordon
893d2f37ba Accept FS#11723 by Michael Hohmuth
Tagcache returns stale numeric (runtime statistics) data


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28645 a1c6a512-1295-4272-9138-f99709370657
2010-11-23 00:15:13 +00:00
Rafaël Carré
961b5dd4c1 tagcache open_files(): open the correct file (missed in r27656)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28114 a1c6a512-1295-4272-9138-f99709370657
2010-09-19 08:17:15 +00:00
Thomas Martitz
6eaab4d004 Ged rid of uisimulator/common/io.c for android builds.
Use host's functions for file i/o directly (open(), close() ,etc.), not the sim_* variants.
Some dir functions need to be wrapped still because we need to cache the parents dir's path (host's dirent doesn't let us know).
For the same reason (incompatibility) with host's dirent) detach some members from Rockbox' dirent struct and put it into an extra one,
the values can be retrieved via the new dir_get_info().

Get rid of the sim_ prefix for sleep as well and change the signature to unix sleep().

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27968 a1c6a512-1295-4272-9138-f99709370657
2010-09-01 21:29:34 +00:00
Thomas Martitz
90b48cd721 Fix last red.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27658 a1c6a512-1295-4272-9138-f99709370657
2010-08-01 16:26:35 +00:00
Thomas Martitz
9c0b2479f7 Rockbox as an application: add get_user_file_path().
For RaaA it evaluates user paths at runtime. For everything but codecs/plugins it will give the path under $HOME/.config/rockbox.org if write access is needed or if the file/folder in question exists there (otherwise it gives /usr/local/share/rockbox).
This allows for installing themes under $HOME as well as having config.cfg and other important files there while installing the application (and default themes) under /usr/local.

On the DAPs it's a no-op, returing /.rockbox directly.

Not converted to use get_user_file_path() are plugins themselves, because RaaA doesn't build plugins yet.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27656 a1c6a512-1295-4272-9138-f99709370657
2010-08-01 16:15:27 +00:00
Miika Pekkarinen
17d2edf1d2 Properly initialize tagcache headers when doing commit() during
boot-up. Should fix "Recently added" entries remaining empty when
dircache is not used nor database is loaded to ram. Also, don't load
load hibernated statefile on H1xx targets when database loading to ram has
been disabled explicitly.



git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27484 a1c6a512-1295-4272-9138-f99709370657
2010-07-18 18:17:47 +00:00
Thomas Martitz
35e8b1429a Rockbox as an application: Replace many occurences of #ifdef SIMULATOR with #if (CONFIG_PLATFORM & PLATFORM_HOSTED) (or equivalently).
The simulator defines PLATFORM_HOSTED, as RaaA will do (RaaA will not define SIMULATOR).
The new define is to (de-)select code to compile on hosted platforms generally.

Should be no functional change to targets or the simulator.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27019 a1c6a512-1295-4272-9138-f99709370657
2010-06-21 16:53:00 +00:00
Amaury Pouly
e24dd5ff98 tagcache: fix queue operation, it should be queue_peek.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26233 a1c6a512-1295-4272-9138-f99709370657
2010-05-21 15:12:07 +00:00
Jonathan Gordon
0e263d5b77 accept FS#10992 by Rui Araújo to fix FS#10976 - make the <Untagged> string translatable
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26192 a1c6a512-1295-4272-9138-f99709370657
2010-05-20 13:24:50 +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
Thomas Martitz
0a1d7c28b7 Make open() posix compliant api-wise. A few calls (those with O_CREAT) need the additional optional mode parameter so add it. Impact for the core is almost zero, as open() is a wrapper macro for the real open function which doesn't take the variable parameter.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25844 a1c6a512-1295-4272-9138-f99709370657
2010-05-06 17:35:13 +00:00
Jonathan Gordon
49f2709a01 If dircache and database "load to ram" is enabled then get the id3 info from the database in the WPS playlist viewer for non buffered tracks
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25841 a1c6a512-1295-4272-9138-f99709370657
2010-05-06 09:22:55 +00:00
Jens Arnold
41ef1d512c Make helper functions static.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25231 a1c6a512-1295-4272-9138-f99709370657
2010-03-17 08:23:50 +00:00
Amaury Pouly
1bff4b32d1 tagcache: Factor ecread of tagfile_entry/index_entry, and ecwrite of index_entry. This should save some binsize and avoid this stupidly repetitive sequence.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25217 a1c6a512-1295-4272-9138-f99709370657
2010-03-16 12:15:56 +00:00
Amaury Pouly
7430bb02a1 tagcache: fix once for all those stupid warnings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25216 a1c6a512-1295-4272-9138-f99709370657
2010-03-16 12:15:44 +00:00
Amaury Pouly
f82c021b8b Fix several misused of 'struct dirent' instead of 'struct dircache_entry' in tagcache.c.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24707 a1c6a512-1295-4272-9138-f99709370657
2010-02-16 22:30:55 +00:00
Amaury Pouly
bb13650d66 Have tagcache_fill_tags also fill the length entry of the mp3entry structure.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24647 a1c6a512-1295-4272-9138-f99709370657
2010-02-14 12:45:59 +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
Amaury Pouly
75fc9ee84b FS#8967: Fix autoscore computation overflow when the playtime is huge.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24471 a1c6a512-1295-4272-9138-f99709370657
2010-02-02 20:49:35 +00:00
Jeffrey Goode
9d842683eb Comment out LOGF_ENABLE defines everywhere, replace evil comments
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23497 a1c6a512-1295-4272-9138-f99709370657
2009-11-03 16:25:03 +00:00
Thomas Martitz
774bacc692 Correct wrong usage of event callbacks all over the place. It's not supposed to return anything, and should take a data parameter.
Fixing it because correcting the event api prototypes causes many warnings.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23301 a1c6a512-1295-4272-9138-f99709370657
2009-10-20 21:54:44 +00:00
Bertrik Sikken
d24d885aa4 Use wrap-safe TIME_BEFORE/TIME_AFTER macros to compare times with current_time, instead of comparing them directly.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23246 a1c6a512-1295-4272-9138-f99709370657
2009-10-18 15:50:30 +00:00