diff --git a/CUETools.Codecs.ALAC/ALACDotNet.cs b/CUETools.Codecs.ALAC/ALACDotNet.cs index 35f7879..04e6cbb 100644 --- a/CUETools.Codecs.ALAC/ALACDotNet.cs +++ b/CUETools.Codecs.ALAC/ALACDotNet.cs @@ -108,10 +108,7 @@ namespace CUETools.Codecs.ALAC int sampleDuration; int sampleSize; if (_iSample >= _sample_byte_size.Length) - { - buff.Length = offset; - return offset; - } + return buff.Length = offset; get_sample_info(_iSample, out sampleDuration, out sampleSize); _IO.Read(_framesBuffer, 0, sampleSize); decodeFrame(sampleSize); @@ -127,7 +124,7 @@ namespace CUETools.Codecs.ALAC _samplesBufferOffset += sampleCount; if (_samplesInBuffer == 0) _samplesBufferOffset = 0; - return offset + sampleCount; + return buff.Length = offset + sampleCount; } public void Close() diff --git a/CUETools.Codecs.FLAKE/FlakeReader.cs b/CUETools.Codecs.FLAKE/FlakeReader.cs index 009338d..90a3a31 100644 --- a/CUETools.Codecs.FLAKE/FlakeReader.cs +++ b/CUETools.Codecs.FLAKE/FlakeReader.cs @@ -249,10 +249,7 @@ namespace CUETools.Codecs.FLAKE fill_frames_buffer(); if (_framesBufferLength == 0) - { - buff.Length = offset; - return offset; - } + return buff.Length = offset; int bytesDecoded = DecodeFrame(_framesBuffer, _framesBufferOffset, _framesBufferLength); _framesBufferLength -= bytesDecoded; @@ -267,7 +264,7 @@ namespace CUETools.Codecs.FLAKE _samplesBufferOffset += sampleCount; if (_samplesInBuffer == 0) _samplesBufferOffset = 0; - return offset + sampleCount; + return buff.Length = offset + sampleCount; } unsafe void fill_frames_buffer() diff --git a/CUETools.Codecs.WMA/WMAReader.cs b/CUETools.Codecs.WMA/WMAReader.cs index f386d6c..c7d6be9 100644 --- a/CUETools.Codecs.WMA/WMAReader.cs +++ b/CUETools.Codecs.WMA/WMAReader.cs @@ -354,7 +354,7 @@ namespace CUETools.Codecs.WMA m_sampleCount = m_sampleOffset / PCM.BlockAlign; if ((buff_offset % PCM.BlockAlign) != 0) throw new Exception("(buff_offset % PCM.BlockAlign) != 0"); - return buff_offset / PCM.BlockAlign; + return buff.Length = buff_offset / PCM.BlockAlign; } throw ex; } @@ -378,7 +378,7 @@ namespace CUETools.Codecs.WMA } if ((buff_offset % PCM.BlockAlign) != 0) throw new Exception("(buff_offset % PCM.BlockAlign) != 0"); - return buff_offset / PCM.BlockAlign; + return buff.Length = buff_offset / PCM.BlockAlign; } } }