Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
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
Show 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:
...
@@ -106,18 +106,19 @@ error:
/**
/**
* Stops all plugins involved in the audio output.
* 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_lock
(
aout
);
aout_FiltersDelete
(
p_aout
);
if
(
owner
->
mixer_format
.
i_format
)
aout_OutputDelete
(
p_aout
);
{
aout_FiltersDelete
(
aout
);
aout_OutputDelete
(
aout
);
}
aout_volume_Delete
(
owner
->
volume
);
aout_volume_Delete
(
owner
->
volume
);
aout_unlock
(
aout
);
var_Destroy
(
p_aout
,
"stereo-mode"
);
var_Destroy
(
aout
,
"stereo-mode"
);
aout_unlock
(
p_aout
);
}
}
#define AOUT_RESTART_OUTPUT 1
#define AOUT_RESTART_OUTPUT 1
...
@@ -133,9 +134,12 @@ static int aout_CheckReady (audio_output_t *aout)
...
@@ -133,9 +134,12 @@ static int aout_CheckReady (audio_output_t *aout)
{
{
const
aout_request_vout_t
request_vout
=
owner
->
request_vout
;
const
aout_request_vout_t
request_vout
=
owner
->
request_vout
;
if
(
owner
->
mixer_format
.
i_format
)
aout_FiltersDelete
(
aout
);
aout_FiltersDelete
(
aout
);
if
(
restart
&
AOUT_RESTART_OUTPUT
)
if
(
restart
&
AOUT_RESTART_OUTPUT
)
{
/* Reinitializes the output */
{
/* Reinitializes the output */
if
(
owner
->
mixer_format
.
i_format
)
aout_OutputDelete
(
aout
);
aout_OutputDelete
(
aout
);
owner
->
mixer_format
=
owner
->
input_format
;
owner
->
mixer_format
=
owner
->
input_format
;
if
(
aout_OutputNew
(
aout
,
&
owner
->
mixer_format
))
if
(
aout_OutputNew
(
aout
,
&
owner
->
mixer_format
))
...
@@ -453,6 +457,7 @@ void aout_DecChangePause (audio_output_t *aout, bool paused, mtime_t date)
...
@@ -453,6 +457,7 @@ void aout_DecChangePause (audio_output_t *aout, bool paused, mtime_t date)
else
else
owner
->
sync
.
end
+=
date
;
owner
->
sync
.
end
+=
date
;
}
}
if
(
owner
->
mixer_format
.
i_format
)
aout_OutputPause
(
aout
,
paused
,
date
);
aout_OutputPause
(
aout
,
paused
,
date
);
aout_unlock
(
aout
);
aout_unlock
(
aout
);
}
}
...
@@ -463,6 +468,7 @@ void aout_DecFlush (audio_output_t *aout)
...
@@ -463,6 +468,7 @@ void aout_DecFlush (audio_output_t *aout)
aout_lock
(
aout
);
aout_lock
(
aout
);
owner
->
sync
.
end
=
VLC_TS_INVALID
;
owner
->
sync
.
end
=
VLC_TS_INVALID
;
if
(
owner
->
mixer_format
.
i_format
)
aout_OutputFlush
(
aout
,
false
);
aout_OutputFlush
(
aout
,
false
);
aout_unlock
(
aout
);
aout_unlock
(
aout
);
}
}
...
@@ -476,7 +482,7 @@ bool aout_DecIsEmpty (audio_output_t *aout)
...
@@ -476,7 +482,7 @@ bool aout_DecIsEmpty (audio_output_t *aout)
aout_lock
(
aout
);
aout_lock
(
aout
);
if
(
owner
->
sync
.
end
!=
VLC_TS_INVALID
)
if
(
owner
->
sync
.
end
!=
VLC_TS_INVALID
)
empty
=
owner
->
sync
.
end
<=
now
;
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
/* The last PTS has elapsed already. So the underlying audio output
* buffer should be empty or almost. Thus draining should be fast
* buffer should be empty or almost. Thus draining should be fast
* and will not block the caller too long. */
* 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