MCPcopy Create free account
hub / github.com/MusicPlayerDaemon/MPD / EncoderToOutputStream

Function EncoderToOutputStream

src/encoder/ToOutputStream.cxx:8–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include "io/OutputStream.hxx"
7
8void
9EncoderToOutputStream(OutputStream &os, Encoder &encoder)
10{
11 while (true) {
12 /* read from the encoder */
13
14 std::byte buffer[32768];
15 const auto r = encoder.Read(buffer);
16 if (r.empty())
17 return;
18
19 /* write everything to the stream */
20
21 os.Write(r);
22 }
23}

Callers 4

mainFunction · 0.85
mainFunction · 0.85
EncoderToFileMethod · 0.85
ReopenFormatMethod · 0.85

Calls 3

emptyMethod · 0.80
ReadMethod · 0.45
WriteMethod · 0.45

Tested by 1

mainFunction · 0.68