This commit is contained in:
Grigory Chudov
2013-04-10 22:21:19 -04:00
parent a7d9ab0de1
commit 8f842e58c1
3 changed files with 9 additions and 16 deletions

View File

@@ -90,15 +90,10 @@ namespace CUETools.Processor
settings.PCM = pcm;
settings.Padding = padding;
settings.Validate();
if (encoder.type != null)
{
object o = Activator.CreateInstance(encoder.type, path, settings);
if (o == null || !(o is IAudioDest))
throw new Exception("Unsupported audio type: " + path + ": " + encoder.type.FullName);
dest = o as IAudioDest;
}
else
throw new Exception("Unsupported audio type: " + path);
object o = Activator.CreateInstance(encoder.type, path, settings);
if (o == null || !(o is IAudioDest))
throw new Exception("Unsupported audio type: " + path + ": " + encoder.type.FullName);
dest = o as IAudioDest;
dest.FinalSampleCount = finalSampleCount;
return dest;
}