aboutsummaryrefslogtreecommitdiff
path: root/src/tag.c
Commit message (Collapse)AuthorAge
* remove clumsy strncpy useEric Wong2006-07-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* gcc signedness and sparse fixesEric Wong2006-07-30
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4489 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* interface/connection malloc reductions from mpd-keEric Wong2006-07-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add mpd-indent.shAvuton Olrich2006-07-20
| | | | | | 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
* some quick hacks to avoid signedness warnings with gcc4Warren Dukes2006-07-17
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4387 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* sparse: ANSI-fy function declarationsEric Wong2006-07-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* De-inline non-trivial, non-performance-critical functionsEric Wong2006-07-15
| | | | | | 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
* [CLEANUP] Remove unused codeAvuton Olrich2006-07-15
| | | | | | Fix whitespace->tabs Use static where possible git-svn-id: https://svn.musicpd.org/mpd/trunk@4346 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Change shank's email addressJ. Alexander Treuman2006-07-14
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4333 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Huge header update, update the copyright and addAvuton Olrich2006-07-13
| | | | | the GPL header where necessary git-svn-id: https://svn.musicpd.org/mpd/trunk@4317 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Add back the id3v1_encoding option. Now it really will convert id3v1 only.J. Alexander Treuman2006-06-21
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4282 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Cleanup getId3Info.J. Alexander Treuman2006-06-21
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4281 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Rewrote id3Dup to search for tags manually. Now libid3tag will actually ↵J. Alexander Treuman2006-06-21
| | | | | 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
* Added Disc # metadata item based on bug 571 (added id3v2 support)Qball Cow2006-04-30
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4131 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* merge with mpd/trunk up to r3925Eric Wong2006-03-16
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@3926 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* remove C++ style commentsEric Wong2005-11-19
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@3689 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Patch to make the configure flag for mpd-mad and mpd-libid3tag more logic ↵Qball Cow2005-09-08
| | | | | (from ticho) git-svn-id: https://svn.musicpd.org/mpd/trunk@3477 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix bug 421: database read failed with newline in ID3-tagWarren Dukes2005-04-30
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@3231 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* removed the id3v1_encoding config option, there's no way to guarantee that ↵Warren Dukes2005-03-11
| | | | | 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
* add support for parsing ape tags in musepack filesWarren Dukes2005-03-07
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@3030 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* added composer, performer, and comment metadata itemsWarren Dukes2005-03-05
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@3022 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* ok, dottemag's id3v1_encoding config parameter should now work.Warren Dukes2004-11-11
| | | | | 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
* we can't store more than 255 tag items per tagWarren Dukes2004-11-10
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2592 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* merge changes from metadata-rewrite branchWarren Dukes2004-11-10
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2589 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* merge shank-rewrite-config changesWarren Dukes2004-10-28
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2375 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* apply dottemag's id3v1 encodings patchWarren Dukes2004-10-05
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2163 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix booboo in validateUtf8Warren Dukes2004-08-12
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2011 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* stripReturnChar() in validateUtf8tag()Warren Dukes2004-08-11
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2001 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* bug fix for metadata again, had an extra "!" in mpdTagsAreEqual()Warren Dukes2004-06-07
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1371 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* mechanism for updating metadata while decodingWarren Dukes2004-06-06
| | | | | | | 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
* todo updateWarren Dukes2004-06-06
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1352 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* '\n' are badWarren Dukes2004-06-02
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1296 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* parsing mp3 id3v2 tags on the fly for streamsWarren Dukes2004-06-01
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1281 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* more efficient of updating of metadataWarren Dukes2004-06-01
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1277 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* icynames are now copied to title of streamsWarren Dukes2004-05-31
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1258 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* aac_pluginWarren Dukes2004-05-31
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1250 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* mp4_pluginWarren Dukes2004-05-31
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1249 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* audiofile_pluginWarren Dukes2004-05-31
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1248 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* little cleanup of plugin stuffWarren Dukes2004-05-31
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1247 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* flac_pluginWarren Dukes2004-05-31
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1246 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* mp3 and ogg plugin stuffWarren Dukes2004-05-31
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1245 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* cleanup EINTR checking in tag.cWarren Dukes2004-05-21
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1127 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* add new inputStream stuff, hopefully something major isn't foobar'dWarren Dukes2004-05-18
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1049 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix a bug in update if unable to open mp4 file, would cause a segfaultWarren Dukes2004-05-15
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1025 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* mp4/aac now use InputStreamWarren Dukes2004-05-06
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@925 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* add vim shiznit to end of all source filesWarren Dukes2004-04-14
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@750 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* ok, rework myfprintf so it uses write() and never use any file streamWarren Dukes2004-04-13
| | | | | | | 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
* block signals when writing db to ensure db isn't corruptedWarren Dukes2004-04-13
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@730 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* rename all ascii/utf8 stuff to latin1/utf8Warren Dukes2004-04-13
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@718 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix a small booboo and add some debugging stuffWarren Dukes2004-04-13
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@708 09075e82-0dd4-0310-85a5-a0d7c8717e4f