Commit Graph

15023 Commits

Author SHA1 Message Date
Max Kellermann
92495d2b0b decoder/mpcdec: fix bogus ReplayGain values
Apparently, libmpcdec sets gain/peak variables to zero if they are not
present.  This clashes with our formula and results in bogus values
which cause noise during playback.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/640
2019-09-13 19:52:11 +02:00
Max Kellermann
9270829b5b ReplayGainInfo: move more code to a function 2019-09-13 19:50:49 +02:00
Max Kellermann
b6243a9945 decoder/mpcdec: merge duplicate code 2019-09-13 19:50:43 +02:00
Max Kellermann
496f88653d ReplayGainInfo: add static method Undefined() 2019-09-13 19:46:39 +02:00
Max Kellermann
5ef645df97 NEWS: add missing line for 818b7e0641 2019-09-08 12:54:16 +02:00
Max Kellermann
bf49c9e4e2 decoder/{dsf,dsdiff}: precalculate bit rate 2019-09-08 12:52:02 +02:00
Max Kellermann
0da9c91af2 decoder/{dsf,dsdiff}: fix displayed bit rate
The formula did not consider the channel count.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/639
2019-09-08 12:45:05 +02:00
Max Kellermann
d63e2c2641 db/update: scan CUE playlist contents
This commit adds a PlaylistPlugin attribute "as_folder" which for now
is only enabled in the "CUE" playlist plugin (which handles separate
"*.cue" files).  If a playlist with this flag set is being scanned
during database update, it will be parsed and its contents will be
added to the database.  This allows clients to inspect them like
directories and its contents will be searchable.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/39
2019-09-08 00:39:53 +02:00
Max Kellermann
5fdb804a50 db/simple/Song: add attribute "target"
Will be used for Song objects representing tracks inside a CUE file.
2019-09-08 00:32:16 +02:00
Max Kellermann
91c1274ac6 db/Song: translate relative "real_uri" paths 2019-09-08 00:31:10 +02:00
Max Kellermann
9caf90f74f util/UriRelative: add uri_apply_relative() 2019-09-08 00:07:37 +02:00
Max Kellermann
71448e645c util/UriExtract: use uri_get_scheme() in uri_has_scheme() 2019-09-08 00:06:52 +02:00
Max Kellermann
0509472636 util/UriExtract: add uri_is_relative_path() 2019-09-08 00:04:49 +02:00
Max Kellermann
0b956cf968 util/StringAPI: add memrchr() wrapper 2019-09-07 23:59:59 +02:00
Max Kellermann
2c3eb5b8ad test/TestUriRelative: new unit test 2019-09-07 23:27:24 +02:00
Max Kellermann
58363cf4dd util/UriRelative: allow "parent" to end with slash 2019-09-07 23:27:24 +02:00
Max Kellermann
2574615fa3 util/UriRelative: use StringAfterPrefix() instead of memcmp()
memcmp() can overrun the buffer.
2019-09-07 23:24:41 +02:00
Max Kellermann
15fbd2b4ab util/UriRelative: use StringIsEqual() 2019-09-07 23:22:16 +02:00
Max Kellermann
ee36a48dbb db/simple/Directory: RemoveSong() returns SongPtr 2019-09-05 21:12:10 +02:00
Max Kellermann
07f212c98c SongSave: return DetachedSong, not a std::unique_ptr<>
Eliminate unnecessary dynamic allocations.
2019-09-05 20:58:04 +02:00
Max Kellermann
a1e2602c3d SongSave: allow throwing any exception 2019-09-05 20:58:00 +02:00
Max Kellermann
b03e4ae692 queue/Save: move code to LoadQueueSong() 2019-09-05 20:56:47 +02:00
Max Kellermann
57808d1a1b queue/Save: queue_load_song() throws on error
Don't catch and log exceptions here; let the caller decide.
2019-09-05 20:55:18 +02:00
Max Kellermann
7775691965 db/simple/Song: rename "uri" to "filename"
This attribute is not a URI; it is just the filename without its
parent directory path.  To avoid confusion, let's rename it to
"filename", leaving the struct without a "uri" attribute.
2019-09-04 12:04:35 +02:00
Max Kellermann
a727150c8d db/simple/Song: remove StringView constructor 2019-09-04 12:03:56 +02:00
Max Kellermann
949916cba1 db/simple/Song: convert NewFrom() to constructor 2019-09-04 12:03:49 +02:00
Max Kellermann
497d090814 db/simple/Song: remove static method NewFile() 2019-09-04 12:03:41 +02:00
Max Kellermann
6a13847287 db/simple/Song: add template constructor 2019-09-04 12:03:37 +02:00
Max Kellermann
cbe7d052e8 db/simple/Song: use PathTraitsUTF8::Build() 2019-09-04 12:02:18 +02:00
Max Kellermann
f4d0bd8205 db/simple/Song: make "parent" a reference, not a pointer 2019-09-04 12:02:17 +02:00
Max Kellermann
1bfede120a fs/Traits: call std::string::reserve() in BuildPathImpl() 2019-09-04 12:01:25 +02:00
Max Kellermann
e96856032f SongSave: use StringIsEqual() 2019-09-04 11:13:39 +02:00
Max Kellermann
05a29e8458 db/simple/Song: simplify Export() 2019-09-03 20:36:39 +02:00
Max Kellermann
7f9a8b8748 db/simple/Song: convert "uri" to a std::string
No longer allocate it as a "VarSize".  This used to be a clever trick
to save memory 10 years ago, but these days, keeping the code
maintainable seems more important than saving a few kilobytes of
memory.
2019-09-03 20:26:47 +02:00
Max Kellermann
af3f637d3f db/simple/Song: pass StringView to constructor 2019-09-03 20:25:04 +02:00
Max Kellermann
97a9adcbec db/update/Archive: convert pointer to reference 2019-09-03 19:54:18 +02:00
Max Kellermann
177d3b0178 db/update/Archive: use MakeDirectoryIfModified() 2019-09-03 19:52:15 +02:00
Max Kellermann
12beb22c1d db/update/VirtualDirectory: add LockMakeVirtualDirectoryIfModified() 2019-09-03 19:51:20 +02:00
Max Kellermann
29fd3172ee db/update/VirtualDirectory: pass device_id to MakeVirtualDirectoryIfModified() 2019-09-03 19:49:32 +02:00
Max Kellermann
a873137702 db/update/VirtualDirectory: rename MakeDirectoryIfModified() 2019-09-03 19:49:10 +02:00
Max Kellermann
e08298a66f db/update/Container: move MakeDirectoryIfModified() to VirtualDirectory.cxx 2019-09-03 19:37:53 +02:00
Max Kellermann
fd1826cb91 db/update/Container: move SupportsContainerSuffix() to struct DecoderPlugin 2019-09-03 19:36:56 +02:00
Max Kellermann
d5681b678c db/update/Walk: move UpdatePlaylistFile() to Playlist.cxx 2019-09-03 18:53:33 +02:00
Max Kellermann
0fd6235a66 playlist/Registry: add FindPlaylistPluginBySuffix() 2019-09-02 20:28:14 +02:00
Max Kellermann
4d11745156 playlist/Plugin: add SupportsSuffix(), SupportsMimeType() 2019-09-02 20:19:47 +02:00
Max Kellermann
2038620bc4 db/simple/Directory: add method IsReallyAFile() 2019-09-02 20:15:52 +02:00
Max Kellermann
5dc7cb87bb db/simple/DirectorySave: use StringIsEqual() 2019-09-02 20:10:26 +02:00
Max Kellermann
f885e068c8 playlist/Plugin: add constructors 2019-09-01 15:01:58 +02:00
Max Kellermann
0d16772dea playlist/Plugin: rename with CamelCase 2019-09-01 14:58:49 +02:00
Max Kellermann
2376527d1f db/DatabaseSong: add noexcept 2019-09-01 14:56:27 +02:00