MusicPipe: eliminate the unused MusicBuffer reference

This requires re-adding the reference to struct DecoderControl, which
was removed recently by commit
9f14e7a98d
This commit is contained in:
Max Kellermann
2018-06-23 18:04:09 +02:00
parent 076be809c2
commit 2be905b2e2
8 changed files with 17 additions and 42 deletions

View File

@@ -98,7 +98,7 @@ DecoderBridge::GetChunk() noexcept
return current_chunk.get();
do {
current_chunk = dc.pipe->GetBuffer().Allocate();
current_chunk = dc.buffer->Allocate();
if (current_chunk != nullptr) {
current_chunk->replay_gain_serial = replay_gain_serial;
if (replay_gain_serial != 0)

View File

@@ -92,7 +92,7 @@ DecoderControl::IsCurrentSong(const DetachedSong &_song) const noexcept
void
DecoderControl::Start(std::unique_ptr<DetachedSong> _song,
SongTime _start_time, SongTime _end_time,
MusicPipe &_pipe) noexcept
MusicBuffer &_buffer, MusicPipe &_pipe) noexcept
{
assert(_song != nullptr);
assert(_pipe.IsEmpty());
@@ -100,6 +100,7 @@ DecoderControl::Start(std::unique_ptr<DetachedSong> _song,
song = std::move(_song);
start_time = _start_time;
end_time = _end_time;
buffer = &_buffer;
pipe = &_pipe;
ClearError();

View File

@@ -44,6 +44,7 @@
#endif
class DetachedSong;
class MusicBuffer;
class MusicPipe;
enum class DecoderState : uint8_t {
@@ -151,6 +152,9 @@ struct DecoderControl final : InputStreamHandler {
SignedSongTime total_time;
/** the #MusicChunk allocator */
MusicBuffer *buffer;
/**
* The destination pipe for decoded chunks. The caller thread
* owns this object, and is responsible for freeing it.
@@ -379,7 +383,7 @@ public:
*/
void Start(std::unique_ptr<DetachedSong> song,
SongTime start_time, SongTime end_time,
MusicPipe &pipe) noexcept;
MusicBuffer &buffer, MusicPipe &pipe) noexcept;
/**
* Caller must lock the object.