mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-22 00:47:13 +01:00
Bug 2782 - 8-bit FLAC samples are not imported correctly
This commit is contained in:
committed by
Paul Licameli
parent
5c291aa855
commit
3ac95672c0
@@ -245,9 +245,15 @@ FLAC__StreamDecoderWriteStatus MyFLACFile::write_callback(const FLAC__Frame *fra
|
|||||||
|
|
||||||
auto iter = mFile->mChannels.begin();
|
auto iter = mFile->mChannels.begin();
|
||||||
for (unsigned int chn=0; chn<mFile->mNumChannels; ++iter, ++chn) {
|
for (unsigned int chn=0; chn<mFile->mNumChannels; ++iter, ++chn) {
|
||||||
if (frame->header.bits_per_sample == 16) {
|
if (frame->header.bits_per_sample <= 16) {
|
||||||
for (unsigned int s=0; s<frame->header.blocksize; s++) {
|
if (frame->header.bits_per_sample == 8) {
|
||||||
tmp[s]=buffer[chn][s];
|
for (unsigned int s = 0; s < frame->header.blocksize; s++) {
|
||||||
|
tmp[s] = buffer[chn][s] << 8;
|
||||||
|
}
|
||||||
|
} else /* if (frame->header.bits_per_sample == 16) */ {
|
||||||
|
for (unsigned int s = 0; s < frame->header.blocksize; s++) {
|
||||||
|
tmp[s] = buffer[chn][s];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
iter->get()->Append((samplePtr)tmp.get(),
|
iter->get()->Append((samplePtr)tmp.get(),
|
||||||
|
|||||||
Reference in New Issue
Block a user