Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
mediastreamer2
Commits
a4d247cb
Commit
a4d247cb
authored
Apr 14, 2010
by
Aymeric Moizard
Browse files
fix memory issue with duplicate
parent
b4833d46
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
src/macsnd.c
src/macsnd.c
+25
-4
No files found.
src/macsnd.c
View file @
a4d247cb
...
...
@@ -133,10 +133,15 @@ MSSndCardDesc ca_card_desc={
static
MSSndCard
*
cacard_duplicate
(
MSSndCard
*
obj
)
{
CaSndDsCard
*
ca
;
CaSndDsCard
*
cadup
;
MSSndCard
*
card
=
ms_snd_card_new
(
&
ca_card_desc
);
card
->
name
=
ms_strdup
(
obj
->
name
);
card
->
data
=
ms_new0
(
CaSndDsCard
,
1
);
memcpy
(
card
->
data
,
obj
->
data
,
sizeof
(
CaSndDsCard
));
ca
=
obj
->
data
;
cadup
=
card
->
data
;
cadup
->
uidname
=
CFStringCreateCopy
(
NULL
,
ca
->
uidname
);
return
card
;
}
...
...
@@ -575,10 +580,18 @@ static int ca_open_r(CAData *d){
desc
.
componentFlagsMask
=
0
;
comp
=
FindNextComponent
(
NULL
,
&
desc
);
if
(
comp
==
NULL
)
return
-
1
;
if
(
comp
==
NULL
)
{
ms_message
(
"Cannot find audio component"
);
return
-
1
;
}
result
=
OpenAComponent
(
comp
,
&
d
->
caInAudioUnit
);
if
(
result
!=
noErr
)
return
-
1
;
if
(
result
!=
noErr
)
{
ms_message
(
"Cannot open audio component %x"
,
result
);
return
-
1
;
}
param
=
1
;
result
=
AudioUnitSetProperty
(
d
->
caInAudioUnit
,
...
...
@@ -695,10 +708,18 @@ static int ca_open_w(CAData *d){
desc
.
componentFlagsMask
=
0
;
comp
=
FindNextComponent
(
NULL
,
&
desc
);
if
(
comp
==
NULL
)
return
-
1
;
if
(
comp
==
NULL
)
{
ms_message
(
"Cannot find audio component"
);
return
-
1
;
}
result
=
OpenAComponent
(
comp
,
&
d
->
caOutAudioUnit
);
if
(
result
!=
noErr
)
return
-
1
;
if
(
result
!=
noErr
)
{
ms_message
(
"Cannot open audio component %x"
,
result
);
return
-
1
;
}
param
=
1
;
result
=
AudioUnitSetProperty
(
d
->
caOutAudioUnit
,
...
...
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