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
736dc505
Commit
736dc505
authored
Dec 15, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aout: fix crashes if restart fails
parent
a9a471da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
14 deletions
+20
-14
src/audio_output/dec.c
src/audio_output/dec.c
+20
-14
No files found.
src/audio_output/dec.c
View file @
736dc505
...
...
@@ -106,18 +106,19 @@ error:
/**
* Stops all plugins involved in the audio output.
*/
void
aout_DecDelete
(
audio_output_t
*
p_
aout
)
void
aout_DecDelete
(
audio_output_t
*
aout
)
{
aout_owner_t
*
owner
=
aout_owner
(
p_
aout
);
aout_owner_t
*
owner
=
aout_owner
(
aout
);
aout_lock
(
p_aout
);
aout_FiltersDelete
(
p_aout
);
aout_OutputDelete
(
p_aout
);
aout_lock
(
aout
);
if
(
owner
->
mixer_format
.
i_format
)
{
aout_FiltersDelete
(
aout
);
aout_OutputDelete
(
aout
);
}
aout_volume_Delete
(
owner
->
volume
);
var_Destroy
(
p_aout
,
"stereo-mode"
);
aout_unlock
(
p_aout
);
aout_unlock
(
aout
);
var_Destroy
(
aout
,
"stereo-mode"
);
}
#define AOUT_RESTART_OUTPUT 1
...
...
@@ -133,10 +134,13 @@ static int aout_CheckReady (audio_output_t *aout)
{
const
aout_request_vout_t
request_vout
=
owner
->
request_vout
;
aout_FiltersDelete
(
aout
);
if
(
owner
->
mixer_format
.
i_format
)
aout_FiltersDelete
(
aout
);
if
(
restart
&
AOUT_RESTART_OUTPUT
)
{
/* Reinitializes the output */
aout_OutputDelete
(
aout
);
if
(
owner
->
mixer_format
.
i_format
)
aout_OutputDelete
(
aout
);
owner
->
mixer_format
=
owner
->
input_format
;
if
(
aout_OutputNew
(
aout
,
&
owner
->
mixer_format
))
owner
->
mixer_format
.
i_format
=
0
;
...
...
@@ -453,7 +457,8 @@ void aout_DecChangePause (audio_output_t *aout, bool paused, mtime_t date)
else
owner
->
sync
.
end
+=
date
;
}
aout_OutputPause
(
aout
,
paused
,
date
);
if
(
owner
->
mixer_format
.
i_format
)
aout_OutputPause
(
aout
,
paused
,
date
);
aout_unlock
(
aout
);
}
...
...
@@ -463,7 +468,8 @@ void aout_DecFlush (audio_output_t *aout)
aout_lock
(
aout
);
owner
->
sync
.
end
=
VLC_TS_INVALID
;
aout_OutputFlush
(
aout
,
false
);
if
(
owner
->
mixer_format
.
i_format
)
aout_OutputFlush
(
aout
,
false
);
aout_unlock
(
aout
);
}
...
...
@@ -476,7 +482,7 @@ bool aout_DecIsEmpty (audio_output_t *aout)
aout_lock
(
aout
);
if
(
owner
->
sync
.
end
!=
VLC_TS_INVALID
)
empty
=
owner
->
sync
.
end
<=
now
;
if
(
empty
)
if
(
empty
&&
owner
->
mixer_format
.
i_format
)
/* The last PTS has elapsed already. So the underlying audio output
* buffer should be empty or almost. Thus draining should be fast
* and will not block the caller too long. */
...
...
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