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
533823ed
Commit
533823ed
authored
Nov 09, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winealsa.drv: Allocate the MIDI device array dynamically.
parent
818385e1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
19 deletions
+7
-19
alsamidi.c
dlls/winealsa.drv/alsamidi.c
+7
-11
mmddk.h
include/mmddk.h
+0
-8
No files found.
dlls/winealsa.drv/alsamidi.c
View file @
533823ed
...
@@ -80,8 +80,8 @@ static pthread_mutex_t seq_mutex = PTHREAD_MUTEX_INITIALIZER;
...
@@ -80,8 +80,8 @@ static pthread_mutex_t seq_mutex = PTHREAD_MUTEX_INITIALIZER;
static
pthread_mutex_t
in_buffer_mutex
=
PTHREAD_MUTEX_INITIALIZER
;
static
pthread_mutex_t
in_buffer_mutex
=
PTHREAD_MUTEX_INITIALIZER
;
static
unsigned
int
num_dests
,
num_srcs
;
static
unsigned
int
num_dests
,
num_srcs
;
static
struct
midi_dest
dests
[
MAX_MIDIOUTDRV
]
;
static
struct
midi_dest
*
dests
;
static
struct
midi_src
srcs
[
MAX_MIDIINDRV
]
;
static
struct
midi_src
*
srcs
;
static
snd_seq_t
*
midi_seq
;
static
snd_seq_t
*
midi_seq
;
static
unsigned
int
seq_refs
;
static
unsigned
int
seq_refs
;
static
int
port_in
=
-
1
;
static
int
port_in
=
-
1
;
...
@@ -298,12 +298,12 @@ static void port_add(snd_seq_client_info_t* cinfo, snd_seq_port_info_t* pinfo, u
...
@@ -298,12 +298,12 @@ static void port_add(snd_seq_client_info_t* cinfo, snd_seq_port_info_t* pinfo, u
snd_seq_port_info_get_name
(
pinfo
),
snd_seq_port_info_get_name
(
pinfo
),
type
);
type
);
if
(
num_dests
>=
MAX_MIDIOUTDRV
)
return
;
if
(
!
type
)
if
(
!
type
)
return
;
return
;
dests
=
realloc
(
dests
,
(
num_dests
+
1
)
*
sizeof
(
*
dests
)
);
dest
=
dests
+
num_dests
;
dest
=
dests
+
num_dests
;
memset
(
dest
,
0
,
sizeof
(
*
dest
)
);
dest
->
addr
=
*
snd_seq_port_info_get_addr
(
pinfo
);
dest
->
addr
=
*
snd_seq_port_info_get_addr
(
pinfo
);
/* Manufac ID. We do not have access to this with soundcard.h
/* Manufac ID. We do not have access to this with soundcard.h
...
@@ -373,12 +373,12 @@ static void port_add(snd_seq_client_info_t* cinfo, snd_seq_port_info_t* pinfo, u
...
@@ -373,12 +373,12 @@ static void port_add(snd_seq_client_info_t* cinfo, snd_seq_port_info_t* pinfo, u
snd_seq_port_info_get_name
(
pinfo
),
snd_seq_port_info_get_name
(
pinfo
),
type
);
type
);
if
(
num_srcs
>=
MAX_MIDIINDRV
)
return
;
if
(
!
type
)
if
(
!
type
)
return
;
return
;
srcs
=
realloc
(
srcs
,
(
num_srcs
+
1
)
*
sizeof
(
*
srcs
)
);
src
=
srcs
+
num_srcs
;
src
=
srcs
+
num_srcs
;
memset
(
src
,
0
,
sizeof
(
*
src
)
);
src
->
addr
=
*
snd_seq_port_info_get_addr
(
pinfo
);
src
->
addr
=
*
snd_seq_port_info_get_addr
(
pinfo
);
/* Manufac ID. We do not have access to this with soundcard.h
/* Manufac ID. We do not have access to this with soundcard.h
...
@@ -505,11 +505,7 @@ static UINT midi_out_open(WORD dev_id, MIDIOPENDESC *midi_desc, UINT flags, stru
...
@@ -505,11 +505,7 @@ static UINT midi_out_open(WORD dev_id, MIDIOPENDESC *midi_desc, UINT flags, stru
WARN
(
"Invalid Parameter !
\n
"
);
WARN
(
"Invalid Parameter !
\n
"
);
return
MMSYSERR_INVALPARAM
;
return
MMSYSERR_INVALPARAM
;
}
}
if
(
dev_id
>=
num_dests
)
if
(
dev_id
>=
num_dests
)
return
MMSYSERR_BADDEVICEID
;
{
TRACE
(
"MAX_MIDIOUTDRV reached !
\n
"
);
return
MMSYSERR_BADDEVICEID
;
}
dest
=
dests
+
dev_id
;
dest
=
dests
+
dev_id
;
if
(
dest
->
midiDesc
.
hMidi
!=
0
)
if
(
dest
->
midiDesc
.
hMidi
!=
0
)
{
{
...
...
include/mmddk.h
View file @
533823ed
...
@@ -30,14 +30,6 @@
...
@@ -30,14 +30,6 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
#define MAX_MIDIINDRV (16)
/* For now I'm making 16 the maximum number of midi devices one can
* have. This should be more than enough for everybody. But as a purist,
* I intend to make it unbounded in the future, as soon as I figure
* a good way to do so.
*/
#define MAX_MIDIOUTDRV (16)
/* ==================================
/* ==================================
* Multimedia DDK compatible part
* Multimedia DDK compatible part
* ================================== */
* ================================== */
...
...
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