mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 20:13:36 +00:00
Updated TranscodingDataStream to be more gapless friendly.
This commit is contained in:
parent
3e3af3c6d2
commit
e85f40bdec
@ -189,6 +189,7 @@ PositionType TranscodingDataStream::Read(void *buffer, PositionType bytesToRead)
|
||||
lame_set_VBR(lame, vbr_off);
|
||||
lame_set_VBR_mean_bitrate_kbps(lame, this->bitrate);
|
||||
lame_set_out_samplerate(lame, this->pcmBuffer->SampleRate());
|
||||
lame_set_bWriteVbrTag(lame, 1);
|
||||
lame_init_params(lame);
|
||||
}
|
||||
}
|
||||
@ -323,11 +324,13 @@ PositionType TranscodingDataStream::Read(void *buffer, PositionType bytesToRead)
|
||||
encodedBytes.realloc(7200);
|
||||
}
|
||||
|
||||
int count = lame_encode_flush(
|
||||
int count = lame_encode_flush_nogap(
|
||||
lame,
|
||||
encodedBytes.data,
|
||||
encodedBytes.length);
|
||||
|
||||
lame_init_bitstream(lame); /* writes XING header for gapless playback */
|
||||
|
||||
this->eof = true;
|
||||
|
||||
if (count >= 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user