1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-16 07:47:58 +01:00

More uses of SampleBuffer, eliminating explicit DeleteSamples calls

This commit is contained in:
Paul Licameli
2016-02-01 10:16:00 -05:00
parent 508286661a
commit 321d5259a2
22 changed files with 145 additions and 156 deletions

View File

@@ -166,7 +166,7 @@ FLAC__StreamDecoderWriteStatus ODFLACFile::write_callback(const FLAC__Frame *fra
///this->ReadData(sampleData, floatSample, 0, mLen);
///This class should call ReadHeader() first, so it knows the length, and can prepare
///the file object if it needs to.
int ODFlacDecoder::Decode(samplePtr & data, sampleFormat & format, sampleCount start, sampleCount len, unsigned int channel)
int ODFlacDecoder::Decode(SampleBuffer & data, sampleFormat & format, sampleCount start, sampleCount len, unsigned int channel)
{
//we need to lock this so the target stays fixed over the seek/write callback.
@@ -182,8 +182,8 @@ int ODFlacDecoder::Decode(samplePtr & data, sampleFormat & format, sampleCount s
mDecodeBufferWritePosition=0;
mDecodeBufferLen = len;
data = NewSamples(len, mFormat);
mDecodeBuffer=data;
data.Allocate(len, mFormat);
mDecodeBuffer = data.ptr();
format = mFormat;
mTargetChannel=channel;