aboutsummaryrefslogtreecommitdiffstats
path: root/src/tag.c (unfollow)
Commit message (Collapse)AuthorFilesLines
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
2004-06-07bug fix for metadata again, had an extra "!" in mpdTagsAreEqual()Warren Dukes1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@1371 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-06mechanism for updating metadata while decodingWarren Dukes1-1/+1
vorbis comments are updated on the fly for streams need to decode icy metadata buffering of metadata needs to be hardened, to ensure that player has already read a particular metachunk or passed over it git-svn-id: https://svn.musicpd.org/mpd/trunk@1358 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-06todo updateWarren Dukes1-0/+6
git-svn-id: https://svn.musicpd.org/mpd/trunk@1352 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-02'\n' are badWarren Dukes1-0/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@1296 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-01parsing mp3 id3v2 tags on the fly for streamsWarren Dukes1-23/+26
git-svn-id: https://svn.musicpd.org/mpd/trunk@1281 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-01more efficient of updating of metadataWarren Dukes1-1/+23
git-svn-id: https://svn.musicpd.org/mpd/trunk@1277 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-05-31icynames are now copied to title of streamsWarren Dukes1-5/+9
git-svn-id: https://svn.musicpd.org/mpd/trunk@1258 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-05-31aac_pluginWarren Dukes1-18/+0
git-svn-id: https://svn.musicpd.org/mpd/trunk@1250 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-05-31mp4_pluginWarren Dukes1-94/+0
git-svn-id: https://svn.musicpd.org/mpd/trunk@1249 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-05-31audiofile_pluginWarren Dukes1-19/+0
git-svn-id: https://svn.musicpd.org/mpd/trunk@1248 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-05-31little cleanup of plugin stuffWarren Dukes1-8/+8
git-svn-id: https://svn.musicpd.org/mpd/trunk@1247 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-05-31flac_pluginWarren Dukes1-114/+0
git-svn-id: https://svn.musicpd.org/mpd/trunk@1246 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-05-31mp3 and ogg plugin stuffWarren Dukes1-84/+0
git-svn-id: https://svn.musicpd.org/mpd/trunk@1245 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-05-21cleanup EINTR checking in tag.cWarren Dukes1-3/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@1127 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-05-18add new inputStream stuff, hopefully something major isn't foobar'dWarren Dukes1-2/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@1049 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-05-15fix a bug in update if unable to open mp4 file, would cause a segfaultWarren Dukes1-0/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@1025 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-05-06mp4/aac now use InputStreamWarren Dukes1-11/+13
git-svn-id: https://svn.musicpd.org/mpd/trunk@925 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-04-14add vim shiznit to end of all source filesWarren Dukes1-0/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@750 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-04-13ok, rework myfprintf so it uses write() and never use any file streamWarren Dukes1-1/+0
print functions. this way we can always know wtf is going on! also, remove some places where we were using fprintf and printf instead of myfprintf git-svn-id: https://svn.musicpd.org/mpd/trunk@734 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-04-13block signals when writing db to ensure db isn't corruptedWarren Dukes1-0/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@730 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-04-13rename all ascii/utf8 stuff to latin1/utf8Warren Dukes1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@718 09075e82-0dd4-0310-85a5-a0d7c8717e4f