CUERipper update;

CTDB xml interface;
Minor bugfixes;
Version 2.0.6-2.0.7
This commit is contained in:
chudov
2010-03-20 07:09:07 +00:00
parent ff3259e08a
commit f01d0b5241
74 changed files with 4203 additions and 1392 deletions

View File

@@ -320,10 +320,20 @@ namespace CUETools.Codecs
length = Math.Min(size, _src.Length - _offset);
if (_length >= 0)
length = Math.Min(length, _length);
dataInBytes = false;
dataInSamples = true;
fixed (int* dest = Samples, src = &_src.Samples[_offset, 0])
AudioSamples.MemCpy(dest, src, Length * pcm.ChannelCount);
if (_src.dataInSamples)
{
dataInBytes = false;
dataInSamples = true;
fixed (int* dest = Samples, src = &_src.Samples[_offset, 0])
AudioSamples.MemCpy(dest, src, Length * pcm.ChannelCount);
}
else
{
dataInSamples = false;
dataInBytes = true;
fixed (byte* dest = Bytes, src = &_src.Bytes[_offset * pcm.BlockAlign])
AudioSamples.MemCpy(dest, src, length * pcm.BlockAlign);
}
}
public void Swap(AudioBuffer buffer)
@@ -1643,10 +1653,12 @@ namespace CUETools.Codecs
int _bufferPos = 0;
Exception _ex = null;
bool own;
ThreadPriority priority;
public AudioPipe(IAudioSource source, int size, bool own)
public AudioPipe(IAudioSource source, int size, bool own, ThreadPriority priority)
{
this.own = own;
this.priority = priority;
_source = source;
_readBuffer = new AudioBuffer(source, size);
_writeBuffer = new AudioBuffer(source, size);
@@ -1655,6 +1667,11 @@ namespace CUETools.Codecs
_samplePos = _source.Position;
}
public AudioPipe(IAudioSource source, int size)
: this(source, size, true, ThreadPriority.BelowNormal)
{
}
private void Decompress(object o)
{
#if !DEBUG
@@ -1695,7 +1712,7 @@ namespace CUETools.Codecs
{
if (_workThread != null || _ex != null) return;
_workThread = new Thread(Decompress);
_workThread.Priority = ThreadPriority.BelowNormal;
_workThread.Priority = priority;
_workThread.IsBackground = true;
_workThread.Start(null);
}