Fix writing TOC in CloneCD format.

This commit is contained in:
2018-06-23 19:41:23 +01:00
parent c7bb65090f
commit decc491d52

View File

@@ -1445,7 +1445,10 @@ namespace DiscImageChef.DiscImages
catalog = Encoding.ASCII.GetString(data);
return true;
case MediaTagType.CD_FullTOC:
fulltoc = data;
fulltoc = new byte[data.Length + 2];
Array.Copy(data, 0, fulltoc, 2, data.Length);
fulltoc[0] = (byte)((data.Length & 0xFF00) >> 8);
fulltoc[1] = (byte)(data.Length & 0xFF);
return true;
default:
ErrorMessage = $"Unsupported media tag {tag}";
@@ -1756,6 +1759,8 @@ namespace DiscImageChef.DiscImages
descriptorStream.WriteLine("PreGapSubC=0");
}
if(nullableToc == null) System.Console.WriteLine("Using fake toc");
for(int i = 0; i < toc.TrackDescriptors.Length; i++)
{
long alba = MsfToLba((toc.TrackDescriptors[i].HOUR, toc.TrackDescriptors[i].Min,