Commit Graph

144 Commits

Author SHA1 Message Date
Max Kellermann c682d087d9 tag/Id3Load: optimized ID3v1 loader
Use a 128 byte buffer instead of reading 10 bytes first and then 118.
2016-02-22 13:14:38 +01:00
Max Kellermann 57da5c0841 tag/Id3Load: simplify end offset calculation 2016-02-22 13:14:37 +01:00
Max Kellermann a224722ae2 tag/Id3Load: add constant ID3V1_SIZE 2016-02-22 13:14:36 +01:00
Max Kellermann 283ef5b163 tag/Id3Load: use ID3_TAG_QUERYSIZE instead of integer literal 2016-02-22 13:14:35 +01:00
Max Kellermann 10f086854b tag/Id3Load: remove unnecessary seek 2016-02-21 13:34:16 +01:00
Max Kellermann 054e9ecaae tag/Id3Load: split tag_id3_read() 2016-02-21 07:14:04 +01:00
Max Kellermann 84fe3bfa87 tag/Id3Load: don't seek twice in tag_id3_read()
Copy the query buffer to the allocated buffer, and read only the
remaining data.
2016-02-19 19:43:05 +01:00
Max Kellermann 2ef8403bfa tag/Id3Load: don't read again if we already have enough data 2016-02-19 19:40:23 +01:00
Max Kellermann 1d3b2baee7 tag/Id3Load: manage id3_tag* with std::unique_ptr 2016-02-19 19:16:40 +01:00
Max Kellermann 86de876b24 tag/TagId3: move tag_id3_load() to Id3Load.cxx 2016-02-19 19:06:06 +01:00
Max Kellermann 8a9f04f7fe tag/Id3: catch exceptions 2016-02-19 18:23:54 +01:00
Max Kellermann a5e8269c72 tag/{Aiff,Riff}: allow fstat() to fail
Omit the file size check if we don't know the size.
2016-02-19 18:16:14 +01:00
Max Kellermann 0acc88cde5 Merge branch 'v0.19.x' 2016-02-19 18:16:04 +01:00
Max Kellermann 4abcb08cc9 tag/{aiff,riff}: fix ID3 chunk padding
Apply padding only to the fseek(), not to the chunk size.  This fixes
bogus "failed to read riff chunk" messages when the last chunk has an
odd size.

See http://bugs.musicpd.org/view.php?id=4486
2016-02-19 17:31:20 +01:00
Max Kellermann 9bc0fada5c Merge tag 'v0.19.12'
release v0.19.12
2015-12-15 22:05:21 +01:00
Benno Fünfstück cae2811762 fix mpd crash on invalid utf8 stream title 2015-12-15 21:49:53 +01:00
Max Kellermann 493f74d94d tag/id3: convert path from "wchar_t*" to "char*" for error message 2015-11-06 09:20:18 +01:00
Max Kellermann 94f850a588 Merge tag 'v0.19.11' 2015-10-27 11:05:47 +01:00
Andreas Mair bea5973e0c Filter out this extra data and leading zeroes in "track" and "disc" tags. 2015-10-21 08:30:33 +02:00
Max Kellermann 205fba74cf tag/ApeLoader: fix buffer overflow after unterminated key 2015-10-16 14:55:40 +02:00
Max Kellermann 356c829b76 util/StringView: new utility class 2015-09-30 22:21:46 +02:00
Max Kellermann f0b58c6f24 db/UniqueTags, tag/Set, ...: use typedef tag_mask_t 2015-08-24 11:53:30 +02:00
Max Kellermann f3661b19c0 tag/Settings: move typedef tag_mask_t to Mask.hxx 2015-08-24 11:40:25 +02:00
Max Kellermann 2f5106c97f tag/Settings: convert to C++ 2015-08-24 11:20:45 +02:00
Max Kellermann 0c19418e84 tag/Settings: convert to bit mask 2015-08-24 11:20:45 +02:00
Max Kellermann 60c077c790 tag/Settings: add function IsTagEnabled() wrapping access to ignore_tag_items[] 2015-08-24 11:20:45 +02:00
Max Kellermann 109b3700b5 Tag: include cleanup 2015-08-24 11:20:45 +02:00
Max Kellermann 58996b841a config/Global: allow calling config_get_string() with one argument
default_value defaults to nullptr.
2015-06-26 08:06:40 +02:00
Max Kellermann d5cfa6d4dc TagId3: remove the "id3v1_encoding" setting
Drop support for misencoded tags.  People should not be using ID3v1
anyway.
2015-06-26 00:15:24 +02:00
Max Kellermann b31d171ae8 *: doxygen fixups 2015-03-17 11:21:43 +01:00
Max Kellermann 39c9669445 fs/Traits: add macro PATH_LITERAL() 2015-03-05 08:58:04 +01:00
Max Kellermann ff2b427cc1 Merge tag 'v0.19.9' 2015-02-06 17:15:31 +01:00
Max Kellermann b3fe3e8b3d TagBuilder: allow adding duplicate tag types in Complement()
Build a table of pre-existing tag types before adding new items.  The
old way would check HasType() each time, which would return true after
the first instance of that tag type had been added, preventing
duplicate tag types to be merged.

This broke duplicate tag types loaded from the state file, because
this code path uses TagBuilder::Complement().
2015-02-06 12:25:34 +01:00
Max Kellermann 25ebb427da tag/Rva2: convert pointers to references 2015-02-04 15:57:32 +01:00
Max Kellermann c5bde10b4f tag/Rva2: rename struct rva2_data to CamelCase 2015-02-04 15:56:59 +01:00
Max Kellermann e582e893cc tag/Rva2: make enum rva2_channel strictly-typed 2015-02-04 15:56:01 +01:00
Max Kellermann 72e44d596f tag/Format: add %iso8601% 2015-01-22 19:10:15 +01:00
Max Kellermann 1c3f5517fa config/Option: convert to strictly-typed enum 2015-01-21 23:30:00 +01:00
Max Kellermann e8debd2e45 output/recorder: dynamic file name 2015-01-14 22:03:26 +01:00
Max Kellermann 712ed555e6 Copyright year 2015 2015-01-01 19:48:13 +01:00
Max Kellermann 412bedb697 Merge branch 'v0.19.x' 2014-12-26 14:40:32 +01:00
Max Kellermann 940cab8620 Merge branch 'v0.18.x' into v0.19.x 2014-12-26 14:28:52 +01:00
Max Kellermann 53f4044890 util/{ASCII,UriUtil}, ...: work around -Wtautological-pointer-compare
New in clang 3.6.
2014-12-26 13:43:32 +01:00
Max Kellermann a66051216f TagId3: add "pure" attributes 2014-12-02 22:17:47 +01:00
Max Kellermann d93172bee8 Compiler.h: add macro CLANG_OR_GCC_VERSION() 2014-11-28 19:09:56 +01:00
Max Kellermann 83fd822e8b ApeTag: drop support for non-standard tag "album artist"
This was used by proprietary software.  MPD adopted it a few years
ago, which turns out to be a mistake, because it now creates problems
for some MPD users (http://bugs.musicpd.org/view.php?id=4168).
2014-11-25 17:07:08 +01:00
Max Kellermann c643b6ff16 configure.ac: add macro MPD_ENABLE_AUTO_PKG_LIB 2014-11-22 23:50:21 +01:00
Max Kellermann b5ba94f1de tag/Set: do AlbumArtist/Artist fallback only if AlbumArtist is not disabled
On "list albumartist", songs that have no AlbumArtist tag will use the
Artist tag.  However, if AlbumArtist is disabled via
"metadata_to_use", the TagBuilder::AddItem() call is ignored, and
PrintUniqueTag() attempts to print a nullptr string.

This commit fixes the problem by attempting the fallback only if
AlbumArtist is not disabled.
2014-11-08 19:25:01 +01:00
Max Kellermann c37f7abb79 TagString: use g_strndup() for unterminated string
Fixes buffer overflow bug.
2014-11-02 11:48:13 +01:00
Max Kellermann 666f700a93 TagString: implement fix_utf8() without GLib 2014-10-10 22:11:38 +02:00