Commit Graph

1774 Commits

Author SHA1 Message Date
Max Kellermann
10da9ee7ba decoder/mad: refactor local variables in FillBuffer() 2019-08-02 23:19:11 +02:00
Max Kellermann
f9eff31205 decoder/mad: use sizeof(input_buffer) 2019-08-02 23:19:11 +02:00
Max Kellermann
1d74a029a2 decoder/mad: simplify variable initialization in FillBuffer() 2019-08-02 23:19:11 +02:00
Max Kellermann
6b8ca514bb decoder/mad: fix broken log message
Broken since commit f8bfea8bae
2019-08-02 22:58:16 +02:00
Max Kellermann
f51e555154 decoder/mad: change "mp3_" suffix to "mad_" 2019-08-02 22:49:55 +02:00
Max Kellermann
61a3c69a06 decoder/mad: make enums strictly-typed 2019-08-02 22:49:55 +02:00
Max Kellermann
089615a01e decoder/mad: include cleanup 2019-08-02 22:49:55 +02:00
Max Kellermann
991bbea875 Merge branch 'v0.21.x' 2019-07-29 11:32:00 +02:00
Max Kellermann
b955334882 decoder/opus: ignore case in replay gain tag names
Closes https://github.com/MusicPlayerDaemon/MPD/issues/604
2019-07-29 10:40:37 +02:00
Max Kellermann
d663f81420 include cleanups (powered by iwyu) 2019-07-05 09:59:58 +02:00
Max Kellermann
4650a903b4 decoder/Bridge: add noexcept 2019-07-05 08:57:51 +02:00
Max Kellermann
01fd6e5e82 Merge branch 'v0.21.x' 2019-06-27 14:51:05 +02:00
Max Kellermann
f07f8f7d88 decoder/wildmidi: add fallbacks for libwildmidi<0.4
Fix build breakage from commit ea639269d8
2019-06-26 23:13:23 +02:00
Max Kellermann
39b40ac1fd decoder/wildmidi: remove unused variable wildmidi_domain 2019-06-26 23:10:20 +02:00
Max Kellermann
ea639269d8 decoder/wildmidi: throw PluginUnavailable on WildMidi_Init() error
Closes https://github.com/MusicPlayerDaemon/MPD/issues/589
2019-06-26 22:40:27 +02:00
Max Kellermann
0abaa3ecc5 decoder/wildmidi: throw PluginUnavailable if config file does not exist
This makes the configuration error more visible, possibly addressing
one part of https://github.com/MusicPlayerDaemon/MPD/issues/589
2019-06-26 22:38:40 +02:00
Max Kellermann
c4d3efe71d decoder/List: handle exception PluginUnavailable 2019-06-26 22:02:54 +02:00
Max Kellermann
85e82e3d4d decoder/List: annotate exceptions thrown by DecoderPlugin::Init() 2019-06-26 22:01:45 +02:00
Max Kellermann
e87f0ca771 pcm/Pcm*: drop more "Pcm" prefixes from source file names 2019-06-17 11:17:48 +02:00
Max Kellermann
a139279575 Copyright year 2019 2019-06-17 11:17:30 +02:00
Max Kellermann
22a9e866bc decoder/mad: make enums strictly-typed 2019-06-16 10:02:51 +02:00
Max Kellermann
97e6ea57c4 decoder/mad: change "mp3_" suffix to "mad_" 2019-06-16 10:01:10 +02:00
Max Kellermann
527642a90b decoder/Plugin: simplify compile-time initialization
Add a `constexpr` constructor and several `constexpr` methods to
construct a DecoderPlugin at compile time, in a way which allows
adding new methods later without having to edit each plugin.
2019-06-15 14:44:37 +02:00
Max Kellermann
aebb1baad8 decoder/sidplay: remove redundant extern 2019-06-15 14:36:12 +02:00
Max Kellermann
8a136b79e5 decoder/opus: pass StringView to ScanOneOpusTag() 2019-06-06 13:27:17 +02:00
Max Kellermann
dffa25c55e decoder/opus: use StringView::Split() 2019-06-06 13:26:35 +02:00
Max Kellermann
548aa00111 tag/Handler: pass StringView to OnTag() and OnPair()
Eliminates a number of allocations, because callers don't need to copy
the strings to a newly allocated buffer only to null-terminate them.
And most callers don't need to have a null-terminated string.
2019-06-06 13:00:53 +02:00
Max Kellermann
b07bbb928a decoder/dsdiff: allow longer tag values 2019-06-06 12:44:25 +02:00
Max Kellermann
3b5a128097 decoder/dsdiff: pass DecoderClient* to dsdiff_handle_native_tag() 2019-06-06 12:43:20 +02:00
Max Kellermann
3e40b1d9d2 decoder/dsdiff: use a fixed-size buffer for the tag value
Variable-length arrays are a C-only feature.
2019-06-06 12:33:14 +02:00
Max Kellermann
adffbba2a5 release v0.21.10
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAlz4JuAQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEq9nD/40/ryDwvgsQnKhYcpPhlV8bf8iTOUSPsrW
 2P5m48sfGb3LBHV+U/sHLWH8svODSxloyvyxYSUOEJyqOu42lj0BnxPBDvRwTjcq
 PxJPHHKVuExys04k4SOKIEci742WEHTVRzO8EeOvIdgkjXCak7tpQk/wmhrGfHF1
 +rLfSu6jq90/tELsOyTLGmk3KapY637Qf2Q99Z6VZnAXhIRLK4O1E8oKGOjl2h8I
 xvjZckVZV1FYeNrC0OYdNQX0A+JhkFwLFAeWP3ksBmKfs+Csf8X0JTCofnYph46t
 5SmhTd9I6NEVnNoZyOplV7QVawGPK1p69ORB052d/9QUhMqcPmwnHrhcrWtrYl5I
 6QtUwf8nJz/TnUc7/a3BBIPHLB/PD0fGsmdDoElikkPz76sGYNor+UZIdQke1HQL
 m3zmNDxjU++sRfrSjAPOK2mxD0Km8tYIcrQBMZcyxoc7GCHaw1pIa2cxxs1aB5QZ
 gFxYICL7LJ+g5Q19JhTiWlwfdOS7jGH7mVUjhLDA/mcxGf6ln6FkDx58GqPJV+es
 UcWVbOjb3T448TVNH0Jj+FrtWK5uBmOFNTk102BbTnfDT8muedbRmRCxn0NyKkFQ
 dS8/FdU7ffw2II49ZI6BfmeLucfoTwuQ1Ky297K/62NrM67/1dKKkBLAE3/aGxwh
 xzIDTT3Mkg==
 =SELi
 -----END PGP SIGNATURE-----

Merge tag 'v0.21.10'

release v0.21.10
2019-06-05 22:38:54 +02:00
Max Kellermann
3fae2150f5 decoder/OpusReader: return StringView
Since we now don't duplicate all items, we can easily remove the 64kB
limit from OpusReader::ReadString() and instead silently ignore and
skip all strings which are longer than 4 kB.

This fixes a tag duplication bug with Opus file containing a very long
`METADATA_BLOCK_PICTURE` tag, which occurred because the Opus plugin
returned false after parsing all tags, and then the MPD core fell back
to FFmpeg which scanned the tags again.
2019-06-05 22:19:35 +02:00
Max Kellermann
5d74b5cee1 input/cache: first draft of the file cache 2019-05-31 17:49:52 +02:00
Max Kellermann
8fef4af7b2 decoder/Bridge: add method OpenLocal() 2019-05-30 17:08:09 +02:00
Max Kellermann
e0d5d88104 Log: make LogLevel the first parameter
Prepare for templated functions.
2019-05-23 12:17:59 +02:00
Max Kellermann
1b5c1f75a4 input/InputStreams: pass std::unique_lock<> to various methods 2019-05-07 19:09:39 +02:00
Max Kellermann
cf348f9fae decoder/Control: pass std::unique_lock<> to Cond::wait() 2019-04-26 18:34:16 +02:00
Max Kellermann
92022658f9 thread/Cond: add wait() overload which takes a unique_lock<>
Just like std::condition_variable, which however has no way to specify
the std::mutex directly.
2019-04-26 11:51:45 +02:00
Max Kellermann
b51bae5500 thread/*Cond: rename methods to match std::condition_variable 2019-04-25 19:46:43 +02:00
Max Kellermann
e740f8d969 decoder/Control: remove unused methods Lock(), Unlock() 2019-04-25 19:34:26 +02:00
Max Kellermann
28fc1d555f decoder/Thread: eliminate decoder_input_stream_open() 2019-04-05 10:32:07 +02:00
Max Kellermann
ac74f284aa decoder/Bridge: check for STOP before InputStream::IsReady()
If the DecoderThread gets woken up by a STOP command, this should be
detected as early as possible.
2019-04-05 10:32:06 +02:00
Max Kellermann
77af999b46 decoder/Thread: use DecoderBridge::OpenUri(), eliminate duplicate code 2019-04-05 10:29:24 +02:00
Max Kellermann
4926763f00 decoder/Bridge: call InputStream::Check() before returning 2019-04-05 10:29:20 +02:00
Max Kellermann
a19eee78c6 decoder/Bridge: make many attributes private 2019-04-05 09:26:03 +02:00
Max Kellermann
6be3c99876 decoder/Bridge: add noexcept 2019-04-05 09:04:08 +02:00
Max Kellermann
8006911a1f decoder/Client: add noexcept 2019-04-05 09:03:42 +02:00
Max Kellermann
61e5828790 input/InputStream: add noexcept to ReadTag() 2019-04-05 08:57:42 +02:00
Max Kellermann
e78d825059 pcm/PcmConvert: eliminate Open() and Close()
Let the constructor and destructor do this.  This means that all users
have to be converted to allocate PcmConvert dynamically.
2019-04-04 21:01:08 +02:00
Max Kellermann
7a1b56fe96 release v0.21.7
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAlykiHUQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFErFWEACP0T0em6pKOV9W2YHivtnJoBhb3wG46a2w
 rnyNuj0FM8nhMsWunvqbOExogGxZziTKYhSdvzOBwNSleG1Eyjks8yNuPpp7nHH/
 Y5gyRr1o6BR4hkukWDAIBWN/iXatUWHb/itInN0KhrqyU0YptNGbOF87vLfAZlqW
 MNVTXO4YAx/tYHEt/4ze/ljtrNvXsB8Zw86cNI+jrivdujdKVfiN5dUpbc5Hj8DA
 3i6Y5YFm4OvHbFENeMy/kVht8Ln0/3Ak+Z9L7ti9ZSWLbOaQc7+Nl0P/3pfftzWf
 YK6DsRyvJ2dEPylAXqRIkZWdIU1VwjKc7cKYJFljNAMhaUWcrefXIGQOv0+1kbqz
 CxLgk3hIK3R7lGbxLXDU7xD05hbOGgXe1BKO9alGhEsyB8+sT6qfVay/RlJPN+da
 mSnslSzPyS+p9ZdyDnWXq68FS8BIriajDVXP7/WNMKz9OEe5BiXBBQVDM5/XbxQU
 qPxLn/BVYzDXOw8msgyIZ/vqE1rpomJDILsK/EMJ/HLAOdR/Jo10wIAGAqiLPp2j
 n2R9jS7nxZKmEvcZkg/HroNiGSpT89f38bbW/MCdzxAkg4vQDxQ0OE9GoeBi3oiP
 g/SkM/sJ9UdlC3bq7TAhxK0huimAEg5Rh6Z1II00D89QmWFQT0hjmxo++9WwCQXw
 CkIiKRf7Ug==
 =KzqS
 -----END PGP SIGNATURE-----

Merge tag 'v0.21.7'

release v0.21.7
2019-04-03 12:32:20 +02:00
Max Kellermann
2e9f3d8b9f decoder/HybridDSD: downgrade log message to "debug"
This plugin is interesting only for a tiny fraction of MPD users, so
let's not spam everybody else's log with it.
2019-03-29 17:15:48 +01:00
Max Kellermann
0c6d22fe47 decoder/ffmpeg: move code to lib/ffmpeg/SampleFormat.hxx 2019-03-18 10:58:46 +01:00
Max Kellermann
a66097129d Merge branch 'v0.21.x' 2019-03-16 14:08:22 +01:00
Max Kellermann
1aa7cdd602 decoder/opus: fix replay gain when there are no other tags
The `tag_builder.empty()` check was wrong for the SubmitReplayGain()
call.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/497
2019-03-16 13:55:19 +01:00
Max Kellermann
0009d53b3f decoder/ffmpeg: add AVCodecContext wrapper class 2019-03-13 09:41:52 +01:00
Max Kellermann
05f7a6d1ff decoder/ffmpeg: add AVFormatContext wrapper class 2019-03-13 00:27:21 +01:00
Max Kellermann
0256bbbbaf decoder/ffmpeg: wider try/catch in ffmpeg_scan_stream() 2019-03-13 00:27:21 +01:00
Max Kellermann
bce608cdbc decoder/ffmpeg: ffmpeg_decode() may throw
Don't catch and log exceptions.  Let the caller handle the error.
2019-03-13 00:20:13 +01:00
Max Kellermann
38a0844cdf decoder/ffmpeg: add AVFrame wrapper class 2019-03-12 23:51:46 +01:00
Max Kellermann
c176d94598 system/ByteOrder: move to util/ 2019-03-08 10:21:10 +01:00
borine
c5df879cf9 decooder/plugins/PcmDecoderPlugin: add missing config for preproceesor macro definitions 2019-03-07 12:31:43 +00:00
borine
0762e5c289 decoder/plugins/PcmDecoderPlugin: guard alsa specific code with pre-processor macro test 2019-03-07 08:26:04 +00:00
borine
945ea51bd4 decoder/plugins/PcmDecoderPlugin: introduce new internal mime type "audio/x-mpd-alsa-pcm"
This mime type is to enable the AlsaInputPlugin to communicate the pcm stream audio format to the decoder
2019-03-06 08:39:47 +00:00
Max Kellermann
7a23c123c8 decoder/List: add RAII class 2019-02-05 22:12:22 +01:00
Max Kellermann
e85b24bee0 decoder/List: add noexcept 2019-02-05 22:11:51 +01:00
Jörg Krause
4f7d52dbf2 meson: add fixed-point Vorbis (Tremor) decoder support
Re-add build support for the fixed-point Vorbis (Tremor) decoder, which
was dropped when switching from Autotools to Meson.

Note, that it is not possible to build both, the Vorbis and the Tremor
decoder.

Closes: #405
2019-01-21 08:35:17 +01:00
Thomas Klausner
3a0480a482 Add missing include of stdlib.h.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/456
2019-01-15 16:52:40 +01:00
Max Kellermann
ce49d99c2f check.h: remove obsolete header
Since we switched from autotools to Meson in commit
94592c1406, we don't need to include
`config.h` early to properly enable large file support.  Meson passes
the required macros on the compiler command line instead of defining
them in `config.h`.

This means we can include `config.h` at any time, whenever we want to
check its macros, and there are no ordering constraints.
2018-11-19 16:33:49 +01:00
Max Kellermann
793fd8c479 decoder/ffmpeg: eliminate GetSampleFormat() 2018-11-04 22:36:17 +01:00
Max Kellermann
6c602811df decoder/ffmepg: fill AudioFormat from AVCodecContext, not AVCodecParameters
`AVCodecParameters` contains values from the codec detected by
avformat_find_stream_info(), but after avcodec_open2(), a different
codec might be selected with a different `AVSampleFormat`.  This leads
to misinterpretation of data returned from FFmpeg, leading to random
noise or silence.

This was observed with FFmpeg 4.0.2 and a TS container file containing
MP2.  A mp3-float codec was detected returning `AV_SAMPLE_FMT_FLTP`,
but finally the `mpegaudiodec_fixed.c` was used, returning
`AV_SAMPLE_FMT_S16`.

By using the audio format from `AVCodecContext`, we ensure that MPD
and FFmpeg always agree on the actual audio format in the buffer.

This removes the FFmpeg bug workaround from commit e1b032cbad which I
assume is obsolete after 7 years.

Fixes #380
2018-11-04 22:30:50 +01:00
Max Kellermann
bd115a4008 decoder/ffmpeg: use AtScopeExit() to call av_packet_unref() 2018-11-04 22:01:33 +01:00
Max Kellermann
08272cdee2 decoder/ffmpeg: require FFmpeg 3.1 or later
Drop some compatibility code.
2018-11-04 21:55:06 +01:00
Max Kellermann
f5c9071494 *: copyright year 2018 2018-10-31 17:54:59 +01:00
Max Kellermann
8bb35e7bb6 decoder/Thread: reimplement HasRemoteTagScanner() using the InputPlugin list 2018-10-25 09:09:21 +02:00
Max Kellermann
9ec86acb9c decoder/Thread: enable output tags for Tidal and Qobuz
Fixes formatted paths in the `recorder` output, closing #345.
2018-10-24 16:38:26 +02:00
Max Kellermann
426bde3f75 decoder/Thread: move check to SongHasVolatileTags() 2018-10-24 16:32:41 +02:00
Max Kellermann
f7141c9201 decoder/Control: convert to class, make various attributes private 2018-10-24 10:47:34 +02:00
Max Kellermann
c2a2573aa5 release v0.20.22
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAlvPX+UQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFElO8EACgPMaiN3m/x1hzJ3QTLzCXgeqSG1vuv1tC
 F+sFISLPx/IoVjTpvd9H8jMt7lD+SYB620pAfNyLIGZpWcTxu1wmaviOghqCqnGP
 sql0vtS9CrRGhsKDi5earox3zecylWJ3PRPXpy/4NjFuFUxE2ij/wbXzDb9UbtMg
 1WnVL++fAlFj54CnPR35XHglYU+X7/bMWApkVUfsKBgyX9aghqLYUIm0jaUjj3Bs
 xB/2Nemd1A88yrc4kqyzbFsN96S/W2eXhDYfPlDwFdplfoRJ8nrEMdwrsn0nabIF
 7x+OsAGAfrz3e00TZdiDSaIy7VU4EFV9ctZVonoCGUluBHL0iG7G7bj2cnd+hVnZ
 ecidfHMUqVO99elmUtWsUQwzbhL/TxM6Fzn2qDwqdwcCWDgHcn4fpXfsY0MRt6NK
 cUhCyspMTuhqS3ohLO6RfiWDActm6QL2IHiDty/WAe1Td0VjOiRQMq7CADHlgn/D
 IalN8kGyWHK5ew+3Iiw5zRoYjNXG4ALZN8cEqVh2R7i2uxh8+qm46HkhticAjfDM
 4mETs3oAZdpOGCgv6Q0eY7tQDKB13DD/303NJaVFb6Iew2TZCWDbFz5HjqYShCZi
 PgnPosdRg0LoQbMah4Uhsj6frs6LEBMpg6c7nScJN/1MoRaOyVNDg03X+rBmPe5z
 XULvdsZ8Sw==
 =8OQx
 -----END PGP SIGNATURE-----

Merge tag 'v0.20.22'

release v0.20.22
2018-10-23 20:10:57 +02:00
Max Kellermann
005e691339 decoder/fluidsynth: adapt to API change in version 2.0
Closes #360
2018-10-23 18:44:28 +02:00
Max Kellermann
e28d1e0f65 decoder/mad: convert Tag** parameter to just Tag* 2018-10-22 09:44:54 +02:00
Max Kellermann
a491d8ae24 decoder/mad: use class UniqueId3Tag 2018-10-22 09:44:50 +02:00
Max Kellermann
3cd5dd15f8 decoder/mad: don't initialize xing::frames 2018-10-22 09:44:48 +02:00
Max Kellermann
562ae44d38 decoder/mad: remove unused attribute from xing::magic 2018-10-22 09:44:46 +02:00
Max Kellermann
650a67dc38 decoder/mad: use mad_bit_skip() where appropriate 2018-10-19 20:24:16 +02:00
Max Kellermann
c63f24e58e decoder/audiofile: larger stack buffer to reduce overhead 2018-10-19 20:04:28 +02:00
Max Kellermann
3be8b02cc2 decoder/sndfile: make vio constexpr
Use `const_cast` to be able to pass it to sf_open_virtual() which has
a wrong parameter declaration.
2018-10-19 19:51:17 +02:00
Max Kellermann
bdfaea0c25 decoder/mad: move parse_id3_mixramp() to src/tag/Id3ReplayGain.cxx 2018-10-19 19:45:32 +02:00
skidoo23
69749eb591 decoder/sidplay: fix typo to avoid linker error with meson (libsidplayfp) 2018-10-16 14:56:40 +02:00
Max Kellermann
94592c1406 build with Meson instead of autotools
So long, autotools!  This is my last MPD related project to migrate
away from it.  It has its strengths, but also very obvious weaknesses
and weirdnesses.  Today, many of its quirks are not needed anymore,
and are cumbersome and slow.  Now welcome our new Meson overlords!
2018-10-14 23:41:38 +02:00
skidoo23
f80ebf68b0 decoder/wavpack: fix warning 'unused variable is_dsd' when compiled with --enable-dsd=no 2018-10-12 01:02:34 +02:00
Max Kellermann
030e603940 decoder/gme: fix include
Broken since commit 08f77c2b60
2018-10-07 22:33:52 +02:00
Max Kellermann
863722545f player/CrossFade, ...: use lround() 2018-09-22 19:08:03 +02:00
Max Kellermann
d3d1d37782 AudioFormat: add TimeToSize(), SizeToTime() 2018-09-21 20:51:08 +02:00
Max Kellermann
90f4e97751 decoder/Client: use std::chrono::duration<double> instead of raw double 2018-09-21 20:42:34 +02:00
Max Kellermann
c0411fa412 decoder/Thread: add noexcept 2018-09-21 17:58:34 +02:00
Max Kellermann
debdf9bb96 decoder/{Thread,Control,...}: rename source files, drop prefix 2018-09-21 17:01:24 +02:00
Max Kellermann
218d9383d7 decoder/Thread: move decoder_thread_start() into DecoderControl 2018-09-21 16:57:54 +02:00
Max Kellermann
ec54754e22 Compiler.h: move to util/ 2018-08-20 16:19:17 +02:00
Max Kellermann
f6b3a88723 Merge branch 'master' of git://github.com/skidoo23/MPD 2018-08-14 19:02:37 +02:00
skidoo23
82e8913c05 decoder/sidplay: support basic and kernal rom (libsidplayfp) 2018-08-12 14:25:11 +02:00