MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ close()

std::future< bool > MayaFlux::IO::SoundFileWriter::close ( )

Post a close command to the worker.

The worker drains the FIFO, flushes the encoder, writes the container trailer, and fulfils the returned future. The caller may co_await or .get() the future, or discard it if completion is not needed.

Safe to call multiple times; subsequent calls return a future that is immediately ready with false.

Returns
future<bool>: true = file complete; false = encode error.

Definition at line 77 of file SoundFileWriter.cpp.

78{
79 if (!m_closing.exchange(true)) {
80 post(CloseCmd {});
81 }
82 return std::async(std::launch::deferred,
83 [f = m_close_future]() { return f.get(); });
84}
bool post(const WorkItem &item)
std::shared_future< bool > m_close_future

References m_close_future, m_closing, and post().

Referenced by ~SoundFileWriter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: