DecoderInternal: wake up the player thread in _flush_chunk()
Merge duplicate code.
This commit is contained in:
parent
5c18e4f114
commit
8e7d6eb151
@ -312,7 +312,6 @@ do_send_tag(Decoder &decoder, const Tag &tag)
|
|||||||
/* there is a partial chunk - flush it, we want the
|
/* there is a partial chunk - flush it, we want the
|
||||||
tag in a new chunk */
|
tag in a new chunk */
|
||||||
decoder_flush_chunk(decoder);
|
decoder_flush_chunk(decoder);
|
||||||
decoder.dc.client_cond.signal();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(decoder.chunk == nullptr);
|
assert(decoder.chunk == nullptr);
|
||||||
@ -422,7 +421,6 @@ decoder_data(Decoder &decoder,
|
|||||||
if (dest.IsNull()) {
|
if (dest.IsNull()) {
|
||||||
/* the chunk is full, flush it */
|
/* the chunk is full, flush it */
|
||||||
decoder_flush_chunk(decoder);
|
decoder_flush_chunk(decoder);
|
||||||
dc.client_cond.signal();
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -442,7 +440,6 @@ decoder_data(Decoder &decoder,
|
|||||||
if (full) {
|
if (full) {
|
||||||
/* the chunk is full, flush it */
|
/* the chunk is full, flush it */
|
||||||
decoder_flush_chunk(decoder);
|
decoder_flush_chunk(decoder);
|
||||||
dc.client_cond.signal();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data = (const uint8_t *)data + nbytes;
|
data = (const uint8_t *)data + nbytes;
|
||||||
@ -535,7 +532,6 @@ decoder_replay_gain(Decoder &decoder,
|
|||||||
replay gain values affect the following
|
replay gain values affect the following
|
||||||
samples */
|
samples */
|
||||||
decoder_flush_chunk(decoder);
|
decoder_flush_chunk(decoder);
|
||||||
decoder.dc.client_cond.signal();
|
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
decoder.replay_gain_serial = 0;
|
decoder.replay_gain_serial = 0;
|
||||||
|
@ -100,4 +100,6 @@ decoder_flush_chunk(Decoder &decoder)
|
|||||||
dc.pipe->Push(decoder.chunk);
|
dc.pipe->Push(decoder.chunk);
|
||||||
|
|
||||||
decoder.chunk = nullptr;
|
decoder.chunk = nullptr;
|
||||||
|
|
||||||
|
dc.client_cond.signal();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user