Commit Graph

92 Commits

Author SHA1 Message Date
Max Kellermann 415de497d3 use more libfmt instead of sprintf() 2023-03-06 19:50:53 +01:00
Max Kellermann 148aca23be use SPDX IDs, replacing the long copyright headers 2023-03-06 14:59:48 +01:00
Max Kellermann fa58db798b lib/fmt/RuntimeError: new library
Replacing FormatRuntimeError().
2022-11-29 14:10:34 +01:00
Max Kellermann cc0def15c4 Copyright year 2022 2022-07-14 17:59:35 +02:00
Max Kellermann 8a0ba7a725 output/Control: GetName() returns std::string& 2022-07-13 13:23:21 +02:00
Max Kellermann 45071607aa output/Interface: pass std::span to Play() 2022-07-12 12:59:47 +02:00
Max Kellermann 596ff7e6bf output/*: use std::span instead of ConstBuffer 2022-07-04 19:14:12 +02:00
Max Kellermann 5ad53a7554 output/Thread: remove duplicate code by calling InternalCloseOutput() 2021-10-22 19:54:47 +02:00
Max Kellermann 1f780b7209 output/Thread: log exception details 2021-10-20 11:24:51 +02:00
Max Kellermann 070c03dbf7 event/Thread, ...: fix printf->libfmt remains 2021-10-19 13:19:07 +02:00
Max Kellermann 72f6e018e7 Log: remove the obsolete printf-style functions 2021-10-13 17:41:19 +02:00
Max Kellermann 6f539cfcd6 Partition, ...: use libfmt for logging 2021-06-24 21:40:11 +02:00
Max Kellermann efde78db77 output/Thread: skip drain calls if there is no data to be played
Keep track of whether there is data being played, and don't call
AudioOutput::Drain() after Cancel() has been called already.
2021-02-15 16:39:13 +01:00
Max Kellermann 5348f8c9c8 copyright year 2021 2021-01-01 19:54:28 +01:00
Max Kellermann 4cb5e69811 output/Interface: add virtual method Interrupt()
This allows interrupting the output thread (for some plugins which
implement this method).  This way, operations can be canceled
properly, instead of waiting for some external entity.
2020-10-02 10:20:39 +02:00
Max Kellermann b0596291a8 output/Thread: simplify the main loop switch
Move the InternalPlay() call and the wake_cond.wait() call into the
`case Command::NONE` and revert all `continue` statements to a simple
`break`.
2020-10-02 10:10:53 +02:00
Max Kellermann c0775d328c output/Filtered: move try/catch from IteratePause() to caller 2020-10-01 20:44:11 +02:00
Rosen Penev ab9f5d2067 replace assert.h with cassert
The former was deprecated with C++14.

According to the C++11 and C++17 standards, both files are identical.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 15:25:38 -07:00
Max Kellermann 37f984ba74 output/Control: avoid sending KILL twice 2020-01-18 21:43:17 +01:00
Max Kellermann 2817bf9e95 copyright year 2020 2020-01-18 19:23:49 +01:00
Max Kellermann e6600b8562 Merge tag 'v0.21.14'
release v0.21.14
2019-08-21 10:52:49 +02:00
Max Kellermann b968e1b6de output/Thread: add missing return in exception handler 2019-08-21 10:20:17 +02:00
Max Kellermann f3d16f6d1b output/Thread: fix typo in comment 2019-08-13 13:08:40 +02:00
Max Kellermann d663f81420 include cleanups (powered by iwyu) 2019-07-05 09:59:58 +02:00
Max Kellermann a139279575 Copyright year 2019 2019-06-17 11:17:30 +02:00
Max Kellermann 620a39afb4 thread/Slack: use std::chrono::duration 2019-05-29 21:11:32 +02:00
Max Kellermann 9d1906da8a {event,output}/Thread: downgrade realtime scheduling errors to "info"
These messages can be confusing, but they are not critical.
2019-05-23 14:24:27 +02:00
Max Kellermann 23d56cb6a1 output/Control: pass std::unique_lock<> to Cond::wait() 2019-04-26 18:28:44 +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 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 228bf7eb09 output/thread: cancel the AudioOutputSource() instead of closing it
This fixes the assertion failure due to calling
AudioOutputSource::Close() twice.
2018-11-12 12:24:25 +01:00
Max Kellermann 5eaf2b8fc3 output/control: always close the AudioOutputSource in RELEASE
Fixes a crash bug with `always_on` outputs which occurs because the
`AudioOutputSource` still has a pointer to an outdated `MusicChunk`.

Fixes #415
2018-11-12 12:21:59 +01:00
Max Kellermann e097fef79e output/control: add command RELEASE
With the new command, the decision to pause or close the output moves
into the output thread.
2018-11-12 12:09:37 +01:00
Max Kellermann 9a813cd3b1 output/Thread: update comment 2018-11-12 12:09:02 +01:00
Max Kellermann f5c9071494 *: copyright year 2018 2018-10-31 17:54:59 +01:00
Max Kellermann 1624a5eb8d output/Control: add another Cond attribute, replacing audio_output_client_notify 2018-06-23 19:11:48 +02:00
Max Kellermann 1bca29f9e2 output/Control: rename "cond" to "wake_cond"
Prepare for adding another Cond attribute.
2018-06-23 19:10:23 +02:00
Max Kellermann eb771eaf0d output/Thread: re-lock the mutex after flush error
Fixes deadlock due to mutex double lock.
2018-01-29 22:30:56 +01:00
Max Kellermann e3ef3e8d71 output/Control: unlock mutex during expensive operations 2018-01-04 10:36:18 +01:00
Max Kellermann 051b8fbb31 output/Thread: add "noexcept" 2018-01-04 09:54:35 +01:00
Max Kellermann 6d0d8cf9cf filter/Filter: add virtual method Flush()
This will be used by filters which have internal buffers which need to
be flushed at the end, e.g. the "soxr" resampler.
2018-01-02 23:15:51 +01:00
Max Kellermann b0199245d5 output/Thread: move code to method InternalDrain() 2018-01-02 18:03:48 +01:00
Max Kellermann b93e3b2cf6 output/Thread: move code to method InternalCloseError() 2018-01-02 18:02:14 +01:00
Max Kellermann ae7fcf4c6b output/Thread: move common code to method Failure() 2018-01-02 18:00:20 +01:00
Max Kellermann 1607754771 output/Thread: update "last_error" after filter/play errors 2018-01-02 17:59:37 +01:00
Max Kellermann 028f659c40 output/Thread: move error handling code into the catch block 2018-01-02 17:48:14 +01:00
Max Kellermann 8dfdacf128 output/Thread: AudioOutput::Play() must not return zero 2018-01-02 17:47:46 +01:00
Max Kellermann e2621d5e44 filter/Plugin: return std::unique_ptr<PreparedFilter> 2017-12-27 11:39:01 +01:00
Max Kellermann 03cf6591c0 output/Source: convert prepared_filter to reference 2017-12-27 11:21:43 +01:00