Minor bugfixes

This commit is contained in:
chudov
2011-07-11 15:16:21 +00:00
parent 766ecd77a5
commit 02d37c8bfc
5 changed files with 29 additions and 19 deletions

View File

@@ -1463,9 +1463,16 @@ namespace Bwg.Scsi
return st;
len = cmd.GetBuffer8(4);
len += 4;
len += 5;
result = new InquiryResult(cmd.GetBuffer(), cmd.BufferSize);
if (len <= cmd.BufferSize)
{
result = new InquiryResult(cmd.GetBuffer(), len);
if (m_logger != null)
m_logger.DumpBuffer(9, "Raw Inquiry Result", cmd.GetBuffer(), len);
return CommandStatus.Success;
}
//
// As an oddity, the Sony DW-G120A only supports requests that are an even number

View File

@@ -1240,29 +1240,22 @@ namespace CUETools.Codecs.FLACCL
else
frame.ch_mode = channels != 2 ? ChannelMode.NotStereo : ChannelMode.LeftRight;
int toUnpack = Math.Min(task.frameSize, eparams.max_prediction_order);
// calculate wbits before unpacking samples.
for (int ch = 0; ch < channels; ch++)
{
int index = ch + iFrame * channels;
frame.subframes[ch].wbits = frame.blocksize > 4
? task.BestResidualTasks[index].wbits : 0;
}
unpack_samples(task, Math.Min(task.frameSize, eparams.max_prediction_order));
for (int ch = 0; ch < channels; ch++)
{
int index = ch + iFrame * channels;
frame.subframes[ch].best.residual = ((int*)task.clResidualPtr) + task.BestResidualTasks[index].residualOffs;
frame.subframes[ch].best.type = SubframeType.Verbatim;
frame.subframes[ch].best.size = (uint)(frame.subframes[ch].obits * frame.blocksize);
frame.subframes[ch].wbits = 0;
if (frame.blocksize > Math.Max(4, eparams.max_prediction_order))
{
if (task.BestResidualTasks[index].size < 0)
throw new Exception("internal error");
if (frame.subframes[ch].best.size > task.BestResidualTasks[index].size
&& (SubframeType)task.BestResidualTasks[index].type != SubframeType.Verbatim)
if (frame.subframes[ch].best.size > task.BestResidualTasks[index].size &&
(SubframeType)task.BestResidualTasks[index].type != SubframeType.Verbatim)
{
frame.subframes[ch].best.type = (SubframeType)task.BestResidualTasks[index].type;
frame.subframes[ch].best.size = (uint)task.BestResidualTasks[index].size;
@@ -1294,18 +1287,27 @@ namespace CUETools.Codecs.FLACCL
throw new Exception("size reported incorrectly");
}
}
if (task.frame.subframes[ch].best.type == SubframeType.Verbatim)
toUnpack = task.frameSize;
if (task.frame.subframes[ch].best.type == SubframeType.LPC && !task.UseGPUOnly)
toUnpack = task.frameSize;
if (task.frame.subframes[ch].best.type == SubframeType.Fixed && !task.UseGPUOnly)
toUnpack = task.frameSize;
}
unpack_samples(task, toUnpack);
for (int ch = 0; ch < channels; ch++)
{
int index = ch + iFrame * channels;
switch (task.frame.subframes[ch].best.type)
{
case SubframeType.Constant:
break;
case SubframeType.Verbatim:
unpack_samples(task, task.frameSize);
break;
case SubframeType.Fixed:
if (!task.UseGPUOnly)
{
unpack_samples(task, task.frameSize);
encode_residual_fixed(task.frame.subframes[ch].best.residual, task.frame.subframes[ch].samples,
task.frame.blocksize, task.frame.subframes[ch].best.order);
@@ -1317,7 +1319,6 @@ namespace CUETools.Codecs.FLACCL
case SubframeType.LPC:
if (!task.UseGPUOnly)
{
unpack_samples(task, task.frameSize);
fixed (int* coefs = task.frame.subframes[ch].best.coefs)
{
if (PCM.BitsPerSample > 16)

View File

@@ -21,6 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{EA2CAE21-940C-4F51-A802-E02ABB97A9B5}</ProjectGuid>
<OutputType>Library</OutputType>
@@ -19,7 +19,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>..\bin\Debug\plugins\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>

View File

@@ -23,6 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>