Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
33839e99
Commit
33839e99
authored
Dec 08, 1998
by
Brian Gerst
Committed by
Alexandre Julliard
Dec 08, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly implement MCI_CDA_STATUS_TYPE_TRACK.
Fix an off-by-one bug with MCI_STATUS_LENGTH.
parent
daf860e5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
5 deletions
+26
-5
mmsystem.h
include/mmsystem.h
+2
-2
mcicda.c
multimedia/mcicda.c
+24
-3
No files found.
include/mmsystem.h
View file @
33839e99
...
...
@@ -2187,8 +2187,8 @@ typedef struct {
/* FIXME: are those constants correct ? */
#define MCI_CDA_STATUS_TYPE_TRACK 0x00004001
#define MCI_CDA_TRACK_AUDIO 0x00000
001
#define MCI_CDA_TRACK_OTHER 0x00000
000
#define MCI_CDA_TRACK_AUDIO 0x00000
440
#define MCI_CDA_TRACK_OTHER 0x00000
441
#define MCI_VD_MODE_PARK (MCI_VD_OFFSET + 1)
...
...
multimedia/mcicda.c
View file @
33839e99
...
...
@@ -72,12 +72,17 @@ typedef struct {
DWORD
dwTotalLen
;
LPDWORD
lpdwTrackLen
;
LPDWORD
lpdwTrackPos
;
LPBYTE
lpbTrackFlags
;
DWORD
dwFirstOffset
;
}
WINE_CDAUDIO
;
static
WINE_CDAUDIO
CDADev
[
MAX_CDAUDIODRV
];
#endif
#ifndef CDROM_DATA_TRACK
#define CDROM_DATA_TRACK 0x04
#endif
/*-----------------------------------------------------------------------*/
/**************************************************************************
...
...
@@ -156,12 +161,18 @@ static BOOL32 CDAUDIO_GetTracksInfo(WINE_CDAUDIO* wcda)
if
(
wcda
->
lpdwTrackPos
!=
NULL
)
free
(
wcda
->
lpdwTrackPos
);
wcda
->
lpdwTrackPos
=
(
LPDWORD
)
malloc
((
wcda
->
nTracks
+
1
)
*
sizeof
(
DWORD
));
if
(
wcda
->
lpdwTrackLen
==
NULL
||
wcda
->
lpdwTrackPos
==
NULL
)
{
if
(
wcda
->
lpbTrackFlags
!=
NULL
)
free
(
wcda
->
lpbTrackFlags
);
wcda
->
lpbTrackFlags
=
(
LPBYTE
)
malloc
((
wcda
->
nTracks
+
1
)
*
sizeof
(
BYTE
));
if
(
wcda
->
lpdwTrackLen
==
NULL
||
wcda
->
lpdwTrackPos
==
NULL
||
wcda
->
lpbTrackFlags
==
NULL
)
{
WARN
(
cdaudio
,
"error allocating track table !
\n
"
);
return
FALSE
;
}
memset
(
wcda
->
lpdwTrackLen
,
0
,
(
wcda
->
nTracks
+
1
)
*
sizeof
(
DWORD
));
memset
(
wcda
->
lpdwTrackPos
,
0
,
(
wcda
->
nTracks
+
1
)
*
sizeof
(
DWORD
));
memset
(
wcda
->
lpbTrackFlags
,
0
,
(
wcda
->
nTracks
+
1
)
*
sizeof
(
BYTE
));
for
(
i
=
0
;
i
<=
wcda
->
nTracks
;
i
++
)
{
if
(
i
==
wcda
->
nTracks
)
#ifdef linux
...
...
@@ -216,6 +227,13 @@ static BOOL32 CDAUDIO_GetTracksInfo(WINE_CDAUDIO* wcda)
wcda
->
lpdwTrackPos
[
i
-
1
]
=
start
;
TRACE
(
cdaudio
,
"track #%u start=%u len=%u
\n
"
,
i
,
start
,
length
);
}
wcda
->
lpbTrackFlags
[
i
]
=
#ifdef linux
(
entry
.
cdte_adr
<<
4
)
|
(
entry
.
cdte_ctrl
&
0x0f
);
#elif defined(__FreeBSD__)
(
toc_buffer
.
addr_type
<<
4
)
|
(
toc_buffer
.
control
&
0x0f
);
#endif
TRACE
(
cdaudio
,
"track #%u flags=%02x
\n
"
,
i
+
1
,
wcda
->
lpbTrackFlags
[
i
]);
}
wcda
->
dwTotalLen
=
total_length
;
TRACE
(
cdaudio
,
"total_len=%u
\n
"
,
total_length
);
...
...
@@ -283,6 +301,7 @@ static DWORD CDAUDIO_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS32A l
wcda
->
dwFirstOffset
=
0
;
wcda
->
lpdwTrackLen
=
NULL
;
wcda
->
lpdwTrackPos
=
NULL
;
wcda
->
lpbTrackFlags
=
NULL
;
if
(
!
CDAUDIO_GetTracksInfo
(
&
CDADev
[
wDevID
]))
{
WARN
(
cdaudio
,
"error reading TracksInfo !
\n
"
);
/* return MCIERR_INTERNAL; */
...
...
@@ -319,6 +338,7 @@ static DWORD CDAUDIO_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS
if
(
--
wcda
->
nUseCount
==
0
)
{
if
(
wcda
->
lpdwTrackLen
!=
NULL
)
free
(
wcda
->
lpdwTrackLen
);
if
(
wcda
->
lpdwTrackPos
!=
NULL
)
free
(
wcda
->
lpdwTrackPos
);
if
(
wcda
->
lpbTrackFlags
!=
NULL
)
free
(
wcda
->
lpbTrackFlags
);
close
(
wcda
->
unixdev
);
}
#endif
...
...
@@ -665,7 +685,7 @@ static DWORD CDAUDIO_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS
TRACE
(
cdaudio
,
"MCI_TRACK #%lu LENGTH=??? !
\n
"
,
lpParms
->
dwTrack
);
if
(
lpParms
->
dwTrack
>
wcda
->
nTracks
)
return
MCIERR_OUTOFRANGE
;
lpParms
->
dwReturn
=
wcda
->
lpdwTrackLen
[
lpParms
->
dwTrack
];
lpParms
->
dwReturn
=
wcda
->
lpdwTrackLen
[
lpParms
->
dwTrack
-
1
];
}
else
{
lpParms
->
dwReturn
=
wcda
->
dwTotalLen
;
}
...
...
@@ -716,7 +736,8 @@ static DWORD CDAUDIO_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS
/* MCI_CDA_STATUS_TYPE_TRACK is very likely to be 0x00004001 */
case
MCI_CDA_STATUS_TYPE_TRACK
:
if
(
!
(
dwFlags
&
MCI_TRACK
))
return
MCIERR_MISSING_PARAMETER
;
lpParms
->
dwReturn
=
0xFFFFFFFF
;
/* FIXME: MCI_CDA_TRACK_AUDIO ou MCI_CDA_TRACK_OTHER */
lpParms
->
dwReturn
=
(
wcda
->
lpbTrackFlags
[
lpParms
->
dwTrack
-
1
]
&
CDROM_DATA_TRACK
)
?
MCI_CDA_TRACK_OTHER
:
MCI_CDA_TRACK_AUDIO
;
TRACE
(
cdaudio
,
"MCI_CDA_STATUS_TYPE_TRACK[%ld]=%08lx
\n
"
,
lpParms
->
dwTrack
,
lpParms
->
dwReturn
);
return
0
;
default:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment