cdvdgigaherz: Fix incorrect dual-layer DVD track info

Single-session DVDs only have 1 track, regardless of whether the DVD is
single or dual layered.
This commit is contained in:
Jonathan Li 2016-03-15 18:04:30 +00:00
parent 643db78cc4
commit 9e2f309e30
1 changed files with 15 additions and 33 deletions

View File

@ -19,49 +19,33 @@ toc_data cdtoc;
s32 cdvdParseTOC() s32 cdvdParseTOC()
{ {
memset(&cdtoc,0,sizeof(cdtoc)); memset(&cdtoc, 0, sizeof(cdtoc));
s32 len = src->GetSectorCount(); s32 len = src->GetSectorCount();
tracks[0].length = len; tracks[0].length = len;
tracks[0].start_lba=0; tracks[0].start_lba = 0;
tracks[0].type=0; tracks[0].type = 0;
tracks[1].start_lba=0; tracks[1].start_lba = 0;
if(len<=0) if (len <= 0)
{ {
curDiskType=CDVD_TYPE_NODISC; curDiskType = CDVD_TYPE_NODISC;
tracks[0].length=0; tracks[0].length = 0;
strack=1; strack = 1;
etrack=0; etrack = 0;
return 0; return 0;
} }
s32 lastaddr = src->GetLayerBreakAddress(); s32 mt = src->GetMediaType();
if (mt >= 0)
if(lastaddr>=0)
{ {
if((lastaddr > 0)&&(tracks[0].length>lastaddr)) tracks[1].length = tracks[0].length;
{ tracks[1].type = 0;
tracks[1].length=lastaddr+1;
tracks[1].type=0;
tracks[2].start_lba = tracks[1].length; strack = 1;
tracks[2].length = tracks[0].length-tracks[1].length; etrack = 1;
tracks[2].type=0;
strack=1;
etrack=2;
}
else
{
tracks[1].length=tracks[0].length;
tracks[1].type=0;
strack=1;
etrack=1;
}
} }
else else
{ {
@ -82,8 +66,6 @@ s32 cdvdParseTOC()
//return 0; //return 0;
} }
#define btoi(b) ((b>>4)*10+(b&0xF))
int length = (cdtoc.Length[0]<<8) | cdtoc.Length[1]; int length = (cdtoc.Length[0]<<8) | cdtoc.Length[1];
int descriptors = length/sizeof(cdtoc.Descriptors[0]); int descriptors = length/sizeof(cdtoc.Descriptors[0]);
for(int i=0;i<descriptors;i++) for(int i=0;i<descriptors;i++)