aboutsummaryrefslogtreecommitdiffstats
path: root/src/tag.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2007-05-26Changing all calls to ERROR() followed by exit(EXIT_FAILURE) with a singleJ. Alexander Treuman1-2/+1
call to FATAL(). git-svn-id: https://svn.musicpd.org/mpd/trunk@6276 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-05The massive copyright updateAvuton Olrich1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@5834 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-03-31Adding tagtypes command to list available tag types (takes metadata_to_useJ. Alexander Treuman1-0/+10
into account). git-svn-id: https://svn.musicpd.org/mpd/trunk@5792 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-03-20Doing those previous SONG_* commits properly. Thanks to normalperson forJ. Alexander Treuman1-1/+1
pointing it out. git-svn-id: https://svn.musicpd.org/mpd/trunk@5673 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-03-20Use SONG_TIME instead of literal "Time: " for consistency with db code.J. Alexander Treuman1-1/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@5668 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-03-09fix bug #1458Warren Dukes1-2/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@5589 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-23Make mpd fetch the Original artist/performer tag from mp3'sQball Cow1-0/+4
git-svn-id: https://svn.musicpd.org/mpd/trunk@5418 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-18Closing some parenthesis around shank's email address in copyright headers.J. Alexander Treuman1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@5376 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-11-26Check that the APE tag length is valid before allocating a buffer for it.J. Alexander Treuman1-0/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@5098 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-09-11tag.c: remove unnecessary #includesEric Wong1-7/+0
git-svn-id: https://svn.musicpd.org/mpd/trunk@4762 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-26Replace strdup and {c,re,m}alloc with x* variants to check for OOM errorsEric Wong1-7/+7
I'm checking for zero-size allocations and assert()-ing them, so we can more easily get backtraces and debug problems, but we'll also allow -DNDEBUG people to live on the edge if they wish. We do not rely on errno when checking for OOM errors because some implementations of malloc do not set it, and malloc is commonly overridden by userspace wrappers. I've spent some time looking through the source and didn't find any obvious places where we would explicitly allocate 0 bytes, so we shouldn't trip any of those assertions. We also avoid allocating zero bytes because C libraries don't handle this consistently (some return NULL, some not); and it's dangerous either way. git-svn-id: https://svn.musicpd.org/mpd/trunk@4690 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-18Cast isostr to char * to fix yet another warningJ. Alexander Treuman1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4655 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-18Change type of isostr to fix warningJ. Alexander Treuman1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4654 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-15Avoid an unnecessary encoding conversion when converting id3v1 tags. Also ↵J. Alexander Treuman1-22/+17
make getID3Info static. git-svn-id: https://svn.musicpd.org/mpd/trunk@4642 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-15tag.c: fix segfault on failed id3v1 character conversionEric Wong1-0/+10
convStrDup() returns NULL if character conversion fails, so make sure we check the return values and drop the tag if we can't get a conversion. This should close bug 1313: http://musicpd.org/mantis/view.php?id=1313 git-svn-id: https://svn.musicpd.org/mpd/trunk@4641 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-11Spelling & GrammarAvuton Olrich1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4612 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-09labels should be on the left most column, no tabbingWarren Dukes1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4605 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-07rewrite getId3Tag so we can get rid of this silly ID3_TAG_BUFLEN crapJ. Alexander Treuman1-28/+21
git-svn-id: https://svn.musicpd.org/mpd/trunk@4594 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-07Indent some #defines in tag.c for better readabilityJ. Alexander Treuman1-8/+8
git-svn-id: https://svn.musicpd.org/mpd/trunk@4592 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-07Reformatting initCommands and fillBufferJ. Alexander Treuman1-2/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4582 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-03Our id3 tag buffer should be an array of bytes, not an array of pointers to ↵J. Alexander Treuman1-4/+4
bytes. Now I know where those warnings came from... git-svn-id: https://svn.musicpd.org/mpd/trunk@4540 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-03Undoing more indent sillinessJ. Alexander Treuman1-8/+4
git-svn-id: https://svn.musicpd.org/mpd/trunk@4536 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30remove clumsy strncpy useEric Wong1-3/+2
strncpy isn't really safe because it doesn't guarantee null termination, and we have had to work around it in several places. strlcpy (from OpenBSD) isn't great, either because it often leaves errors going unchecked (by truncating strings). So we'll add the pathcpy_trunc() function with is basically strlcpy with a hardcoded MAXPATHLEN as the limit, and we'll acknowledge truncation since we only work on paths and MAXPATHLEN should be set correctly by the system headers[1]. file-specific notes: inputStream_http: eyeballing the changes here, it seems to look alright but I haven't actually tested it myself. ls: don't even bother printing a file if the filename is too long (and when is it ever?) since we won't be able to read it anyways. metadataChunk: it's only metadata, and it's only for showin the user, so truncating it here souldn't be a big issue. memset to zero in init is unecessary, so lets not waste cycles [1] - If the system headers are screwed up, then we're majorly screwed regardless of what we do :x git-svn-id: https://svn.musicpd.org/mpd/trunk@4491 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30gcc signedness and sparse fixesEric Wong1-3/+3
git-svn-id: https://svn.musicpd.org/mpd/trunk@4489 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30interface/connection malloc reductions from mpd-keEric Wong1-3/+3
This patch massively reduces the amount of heap allocations at the interface/command layer. Most commands with minimal output should not allocate memory from the heap at all. Things like repeatedly polling status, currentsong, and volume changes should be faster as a result, and more importantly, not a source of memory fragmentation. These changes should be safe in that there's no way for a remote-client to corrupt memory or otherwise do bad stuff to MPD, but an extra set of eyes to review would be good. Of course there's never any warranty :) No longer do we use FILE * structures in the interface, which means we don't have to allocate any new memory for most connections. Now, before you go on about losing the buffering that FILE * +implies+, remember that myfprintf() never took advantage of any of the stdio buffering features. To reduce the diff and make bugs easier to spot in the diff, I've kept myfprintf in places where we write to files (and not network interfaces). Expect myfprintf to go away entirely soon (we'll use fprintf for writing regular files). git-svn-id: https://svn.musicpd.org/mpd/trunk@4483 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-20Add mpd-indent.shAvuton Olrich1-146/+198
Indent the entire tree, hopefully we can keep it indented. git-svn-id: https://svn.musicpd.org/mpd/trunk@4410 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-17some quick hacks to avoid signedness warnings with gcc4Warren Dukes1-5/+5
git-svn-id: https://svn.musicpd.org/mpd/trunk@4387 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-17sparse: ANSI-fy function declarationsEric Wong1-2/+2
These are just warnings from sparse, but it makes the output easier to read. I ran this through a quick perl script, but of course verified the output by looking at the diff and making sure the thing still compiles. here's the quick perl script I wrote to generate this patch: ----------- 8< ----------- use Tie::File; defined(my $pid = open my $fh, '-|') or die $!; if (!$pid) { open STDERR, '>&STDOUT' or die $!; exec 'sparse', @ARGV or die $!; } my $na = 'warning: non-ANSI function declaration of function'; while (<$fh>) { print STDERR $_; if (/^(.+?\.[ch]):(\d+):(\d+): $na '(\w+)'/o) { my ($f, $l, $pos, $func) = ($1, $2, $3, $4); $l--; tie my @x, 'Tie::File', $f or die "$!: $f"; print '-', $x[$l], "\n"; $x[$l] =~ s/\b($func\s*)\(\s*\)/$1(void)/; print '+', $x[$l], "\n"; untie @x; } } git-svn-id: https://svn.musicpd.org/mpd/trunk@4378 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-15De-inline non-trivial, non-performance-critical functionsEric Wong1-1/+1
Functions that should stay inlined should have an explanation attached to them. git-svn-id: https://svn.musicpd.org/mpd/trunk@4355 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-15[CLEANUP] Remove unused codeAvuton Olrich1-17/+1
Fix whitespace->tabs Use static where possible git-svn-id: https://svn.musicpd.org/mpd/trunk@4346 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-14Change shank's email addressJ. Alexander Treuman1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4333 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-13Huge header update, update the copyright and addAvuton Olrich1-1/+1
the GPL header where necessary git-svn-id: https://svn.musicpd.org/mpd/trunk@4317 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-06-21Add back the id3v1_encoding option. Now it really will convert id3v1 only.J. Alexander Treuman1-0/+14
git-svn-id: https://svn.musicpd.org/mpd/trunk@4282 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-06-21Cleanup getId3Info.J. Alexander Treuman1-7/+4
git-svn-id: https://svn.musicpd.org/mpd/trunk@4281 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-06-21Rewrote id3Dup to search for tags manually. Now libid3tag will actually ↵J. Alexander Treuman1-12/+136
tell us the version of the tag we got. As an added benefit we also do fewer reads/mallocs when scanning mp3s during database update/creation. git-svn-id: https://svn.musicpd.org/mpd/trunk@4277 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-04-30Added Disc # metadata item based on bug 571 (added id3v2 support)Qball Cow1-1/+6
git-svn-id: https://svn.musicpd.org/mpd/trunk@4131 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-03-16merge with mpd/trunk up to r3925Eric Wong1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@3926 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2005-11-19remove C++ style commentsEric Wong1-2/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@3689 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2005-09-08Patch to make the configure flag for mpd-mad and mpd-libid3tag more logic ↵Qball Cow1-0/+1
(from ticho) git-svn-id: https://svn.musicpd.org/mpd/trunk@3477 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2005-04-30fix bug 421: database read failed with newline in ID3-tagWarren Dukes1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@3231 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2005-03-11removed the id3v1_encoding config option, there's no way to guarantee that ↵Warren Dukes1-16/+1
we actually got a given field from the v1 and not the v2 tag git-svn-id: https://svn.musicpd.org/mpd/trunk@3052 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2005-03-07add support for parsing ape tags in musepack filesWarren Dukes1-0/+107
git-svn-id: https://svn.musicpd.org/mpd/trunk@3030 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2005-03-05added composer, performer, and comment metadata itemsWarren Dukes1-1/+13
git-svn-id: https://svn.musicpd.org/mpd/trunk@3022 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-11ok, dottemag's id3v1_encoding config parameter should now work.Warren Dukes1-1/+19
dottemag can you test it? i made one little tweak git-svn-id: https://svn.musicpd.org/mpd/trunk@2620 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-10we can't store more than 255 tag items per tagWarren Dukes1-0/+3
git-svn-id: https://svn.musicpd.org/mpd/trunk@2592 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-10merge changes from metadata-rewrite branchWarren Dukes1-91/+214
git-svn-id: https://svn.musicpd.org/mpd/trunk@2589 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-10-28merge shank-rewrite-config changesWarren Dukes1-12/+0
git-svn-id: https://svn.musicpd.org/mpd/trunk@2375 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-10-05apply dottemag's id3v1 encodings patchWarren Dukes1-0/+14
git-svn-id: https://svn.musicpd.org/mpd/trunk@2163 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-08-12fix booboo in validateUtf8Warren Dukes1-4/+4
git-svn-id: https://svn.musicpd.org/mpd/trunk@2011 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-08-11stripReturnChar() in validateUtf8tag()Warren Dukes1-5/+5
git-svn-id: https://svn.musicpd.org/mpd/trunk@2001 09075e82-0dd4-0310-85a5-a0d7c8717e4f