Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
eb72c5a3
Commit
eb72c5a3
authored
Nov 25, 2013
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auhal: fix crash on error paths for stream format change
ref #9957
parent
7e94e20b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
modules/audio_output/auhal.c
modules/audio_output/auhal.c
+9
-4
No files found.
modules/audio_output/auhal.c
View file @
eb72c5a3
...
...
@@ -1863,6 +1863,8 @@ static int AudioStreamChangeFormat(audio_output_t *p_aout, AudioStreamID i_strea
OSStatus
err
=
noErr
;
UInt32
i_param_size
=
0
;
int
retValue
=
true
;
AudioObjectPropertyAddress
physicalFormatAddress
=
{
kAudioStreamPropertyPhysicalFormat
,
kAudioObjectPropertyScopeGlobal
,
kAudioObjectPropertyElementMaster
};
struct
{
vlc_mutex_t
lock
;
vlc_cond_t
cond
;
}
w
;
...
...
@@ -1878,7 +1880,8 @@ static int AudioStreamChangeFormat(audio_output_t *p_aout, AudioStreamID i_strea
err
=
AudioObjectAddPropertyListener
(
i_stream_id
,
&
physicalFormatAddress
,
StreamListener
,
(
void
*
)
&
w
);
if
(
err
!=
noErr
)
{
msg_Err
(
p_aout
,
"AudioObjectAddPropertyListener for kAudioStreamPropertyPhysicalFormat failed [%4.4s]"
,
(
char
*
)
&
err
);
return
false
;
retValue
=
false
;
goto
out
;
}
/* change the format */
...
...
@@ -1886,7 +1889,8 @@ static int AudioStreamChangeFormat(audio_output_t *p_aout, AudioStreamID i_strea
&
change_format
);
if
(
err
!=
noErr
)
{
msg_Err
(
p_aout
,
"could not set the stream format [%4.4s]"
,
(
char
*
)
&
err
);
return
false
;
retValue
=
false
;
goto
out
;
}
/* The AudioStreamSetProperty is not only asynchronious (requiring the locks)
...
...
@@ -1913,11 +1917,12 @@ static int AudioStreamChangeFormat(audio_output_t *p_aout, AudioStreamID i_strea
/* We need to check again */
}
out:
/* Removing the property listener */
err
=
AudioObjectRemovePropertyListener
(
i_stream_id
,
&
physicalFormatAddress
,
StreamListener
,
(
void
*
)
&
w
);
if
(
err
!=
noErr
)
{
msg_Err
(
p_aout
,
"AudioStreamRemovePropertyListener failed [%4.4s]"
,
(
char
*
)
&
err
);
ret
urn
false
;
ret
Value
=
false
;
}
/* Destroy the lock and condition */
...
...
@@ -1925,5 +1930,5 @@ static int AudioStreamChangeFormat(audio_output_t *p_aout, AudioStreamID i_strea
vlc_mutex_destroy
(
&
w
.
lock
);
vlc_cond_destroy
(
&
w
.
cond
);
return
tr
ue
;
return
retVal
ue
;
}
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