aboutsummaryrefslogtreecommitdiffstats
path: root/src/tag.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2009-11-04tag: added function tag_name_parse()Max Kellermann1-9/+41
Convert a string into a tag_type enum.
2009-10-13tag: removed the "_ITEM_" suffix from the enum namesMax Kellermann1-13/+13
2009-07-09Implement ArtistSort tagBart Nagel1-0/+1
2009-07-07tag: added tag "AlbumArtistSort"Max Kellermann1-0/+1
The tag_id3.c library supports both the documented "TSO2" tag, and the inofficial TXXX/ALBUMARTISTSORT. The Vorbis/FLAC decoder automatically supports the new tag, without further change.
2009-04-28song_save: don't call tag_free(NULL)Max Kellermann1-0/+2
When a song was in the database twice (which shouldn't happen), and the first song had no tag items, MPD calledd tag_free(NULL). Add a check to that source location, and an assertion to tag_free().
2009-04-28tag: use g_ascii_strcasecmp() instead of strcasecmp()Max Kellermann1-2/+2
strcasecmp() is locale dependent, making it a bad choice for internal string comparisons.
2009-03-15log: removed DEBUG() and FATAL()Max Kellermann1-3/+2
Use GLib the logging functions g_debug(), g_error() instead.
2009-03-13all: Update copyright header.Avuton Olrich1-6/+7
This updates the copyright header to all be the same, which is pretty much an update of where to mail request for a copy of the GPL and the years of the MPD project. This also puts all committers under 'The Music Player Project' umbrella. These entries should go individually in the AUTHORS file, for consistancy.
2009-03-01tag: convert ignore_tag_items to a bool arrayMax Kellermann1-5/+5
2009-03-01tag: no CamelCaseMax Kellermann1-8/+8
Renamed functions and variables.
2009-02-28tag: moved APE code to tag_ape.cMax Kellermann1-120/+0
2009-02-27tag: don't accept invalid UTF-8 sequencesMax Kellermann1-5/+27
Overwrite invalid UTF-8 sequences with question marks.
2009-02-27tag: make tag.num_items unsignedMax Kellermann1-13/+4
There's no point in declaring num_items as a uint8_t, it doesn't save any space, due to padding. This allows us to lift the articial "255 items" limitation.
2009-02-27tag: no CamelCaseMax Kellermann1-37/+38
Renamed numOfItems to num_items.
2009-02-27tag: make tag_equal() return boolMax Kellermann1-12/+12
2009-02-17tag: fixed typo in MUSICBRAINZ_TRACKID tag nameMax Kellermann1-1/+1
2009-01-25tag: remove unused variable paramLaszlo Ashin1-3/+2
This variable doesn't have a role since 80799fa8.
2009-01-25use g_free() instead of free()Max Kellermann1-8/+6
On some platforms, g_free() must be used for memory allocated by GLib. This patch intends to correct a lot of occurrences, but is probably not complete.
2009-01-25conf: const pointers in block get functionsMax Kellermann1-1/+1
All config_get_block_*() functions should accept constant config_param pointers.
2009-01-25use config_get_string() instead of config_get_param()Max Kellermann1-5/+5
config_get_string() is easier to use than config_get_param() because it unpacks the config_param struct.
2009-01-24tag: added support for MusicBrainz tagsMax Kellermann1-1/+7
Added all important id tags from the MusicBrainz wiki: http://musicbrainz.org/doc/MusicBrainzTag This should automatically enable its suport in the vorbis and flac decoder plugins.
2009-01-17conf: no CamelCase, part IMax Kellermann1-2/+2
Renamed functions, types, variables.
2009-01-15tag: added tag_get_value()Max Kellermann1-3/+9
2009-01-13tag: added core support for the "album artist" tagMax Kellermann1-0/+1
Added TAG_ITEM_ALBUM_ARTIST. With this patch, MPD should be able to read the (inofficial) "ALBUMARTIST" Vorbis comment. Implementations in other decoder plugins will follow soon.
2009-01-04tag: allocate space for null terminator in clear_non_printable()Max Kellermann1-3/+1
Use g_strndup() instead of g_memdup().
2009-01-04path, tag: don't allocate GError for charset conversionMax Kellermann1-5/+2
Pass NULL instead of &error to g_convert(). We're not interested in the error object.
2009-01-03tag: added function tag_merge()Max Kellermann1-0/+46
tag_merges() merges the data from two tag objects into one.
2009-01-03tag: revert g_strescape() patchMax Kellermann1-7/+56
Don't use g_strescape(), because it escapes all non-ASCII characters. Add a new function which clears all non-printable characters, not just "newline".
2009-01-03tag: use g_strescape() to eliminate evil charactersMax Kellermann1-18/+22
This always allocates strings on the heap, but we can delete the stripReturnChar() function now.
2008-12-28tag & tag_pool: migrate from pthread to glib threadsThomas Jansen1-8/+8
2008-11-03tag: added function tag_has_type()Max Kellermann1-0/+12
tag_has_type() checks whether the tag contains one or more items with the specified type.
2008-11-01tag: use GLib instead of utils.hMax Kellermann1-8/+10
Don't use the deprecated functions from utils.h.
2008-11-01utils: use GUINT32_FROM_LE() instead of readLEuint32()Max Kellermann1-8/+8
Eliminate code already provided by GLib.
2008-11-01tag: don't return const string from fix_utf8()Max Kellermann1-13/+13
Return NULL instead of the input value if there is nothing to fix. This way, the caller doesn't have to use the xfree() hack.
2008-10-31removed UTF-8 library, use GLib insteadMax Kellermann1-4/+12
Removed duplicated code.
2008-10-08don't include os_compat.hMax Kellermann1-0/+2
When there are standardized headers, use these instead of the bloated os_compat.h.
2008-10-06tag: merge clearMpdTag into tag_freeEric Wong1-12/+2
avoid some redundant clearing logic as well, since the tag is getting freed.
2008-09-29Switch to C99 types (retaining compat with old compilers)Eric Wong1-1/+1
Seeing the "mpd_" prefix _everywhere_ is mind-numbing as the mind needs to retrain itself to skip over the first 4 tokens of a type to get to its meaning. So avoid having extra characters on my terminal to make it easier to follow code at 2:30 am in the morning. Please report any new issues you may come across on Free toolchains. I realize how difficult it can be to build/maintain cross-compiling toolchains and I have no intention of forcing people to upgrade their toolchains to build mpd. Tested with gcc 2.95.4 and and gcc 4.3.1 on x86-32.
2008-09-08use strset.h instead of tagTracker.hMax Kellermann1-1/+0
With a large music database, the linear string collection in tagTracker.c becomes very slow. We implemented that in a quick'n'dirty fashion when we removed tree.c, and now we rewrite it using the fast hashed string set.
2008-09-07tag: oops, of course items is now ** and not *Eric Wong1-2/+2
Gah, it seems like doing sizeof here either way is error prone. Too easy to leave out a '*' character we can forget.
2008-09-07tag: lock all accesses to tag_poolEric Wong1-6/+10
The tag pool is a shared global resource that is infrequently modified. However, it can occasionally be modified by several threads, especially by the metadata_pipe for streaming metadata (both reading/writing). The bulk tag_item pool is NOT locked as currently only the update thread uses it.
2008-09-07tag: introduce handy items_size() functionEric Wong1-11/+12
Trying to read or remember "tag->numOfItems * sizeof(*tag->items)" requires too much thinking and mental effort on my part. Also, favor "sizeof(struct mpd_tag)" over "sizeof(*tag->items)" because the former is easier to read and follow, even though the latter is easier to modify if the items member changes to a different type.
2008-09-07tag: moved code to tag_print.cMax Kellermann1-25/+2
Move everything which dumps a tag to a file descriptor to tag_print.c. This relaxes dependencies and splits the code into smaller parts.
2008-09-06tag: fix segfault on updateEric Wong1-14/+21
clearMpdTag could be called on a tag that was still in a tag_begin_add transaction before tag_end_add is called. This was causing free() to attempt to operate on bulk.items; which is un-free()-able. Now instead we unmark the bulk.busy to avoid committing the tags to the heap only to be immediately freed. Additionally, we need to remember to call tag_end_add() when a song is updated before we NULL song->tag to avoid tripping an assertion the next time tag_begin_add() is called.
2008-08-29tag: optimize tag_dup(), copy item referencesMax Kellermann1-1/+3
Don't call tag_pool_get_item() for duplicating tags, just increase the item's reference counter instead.
2008-08-29const pointersMax Kellermann1-4/+4
Yet another patch which converts pointer arguments to "const".
2008-08-29tag: try not to reallocate tag.items in every add() callMax Kellermann1-2/+60
If many tag_items are added at once while the tag cache is being loaded, manage these items in a static fixed list, instead of reallocating the list with every newly created item. This reduces heap fragmentation. Massif results again: mk before: total 12,837,632; useful 10,626,383; extra 2,211,249 mk now: total 12,736,720; useful 10,626,383; extra 2,110,337 The "useful" value is the same since this patch only changes the way we allocate the same amount of memory, but heap fragmentation was reduced by 5%.
2008-08-29tag: try not to duplicate the input stringMax Kellermann1-13/+18
Try to detect if the string needs Latin1-UTF8 conversion, or whitespace cleanup. If not, we don't need to allocate temporary memory, leading to decreased heap fragmentation.
2008-08-29tag: pass length to fix_utf8()Max Kellermann1-3/+4
Same as the previous patch, prepare the function fix_utf8() this time.
2008-08-29added "length" parameter to validUtf8String()Max Kellermann1-1/+1
At several places, we create temporary copies of non-null-terminated strings, just to use them in functions like validUtf8String(). We can save this temporary allocation and avoid heap fragmentation if we add a length parameter instead of expecting a null-terminated string.