Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
3074c601
Commit
3074c601
authored
Nov 26, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Protect audio decoder against invalid date.
parent
5708e0cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
11 deletions
+20
-11
src/input/decoder.c
src/input/decoder.c
+20
-11
No files found.
src/input/decoder.c
View file @
3074c601
...
@@ -335,14 +335,12 @@ void input_DecoderDelete( decoder_t *p_dec )
...
@@ -335,14 +335,12 @@ void input_DecoderDelete( decoder_t *p_dec )
vlc_object_kill
(
p_dec
);
vlc_object_kill
(
p_dec
);
/* Make sure we aren't paused anymore */
/* Make sure we aren't paused
/buffering/waiting
anymore */
vlc_mutex_lock
(
&
p_owner
->
lock
);
vlc_mutex_lock
(
&
p_owner
->
lock
);
if
(
p_owner
->
b_paused
||
p_owner
->
b_buffering
)
p_owner
->
b_paused
=
false
;
{
p_owner
->
b_buffering
=
false
;
p_owner
->
b_paused
=
false
;
p_owner
->
b_flushing
=
true
;
p_owner
->
b_buffering
=
false
;
vlc_cond_signal
(
&
p_owner
->
wait
);
vlc_cond_signal
(
&
p_owner
->
wait
);
}
vlc_mutex_unlock
(
&
p_owner
->
lock
);
vlc_mutex_unlock
(
&
p_owner
->
lock
);
vlc_thread_join
(
p_dec
);
vlc_thread_join
(
p_dec
);
...
@@ -1150,12 +1148,23 @@ static void DecoderPlayAudio( decoder_t *p_dec, aout_buffer_t *p_audio,
...
@@ -1150,12 +1148,23 @@ static void DecoderPlayAudio( decoder_t *p_dec, aout_buffer_t *p_audio,
i_rate
>
INPUT_RATE_DEFAULT
*
AOUT_MAX_INPUT_RATE
)
i_rate
>
INPUT_RATE_DEFAULT
*
AOUT_MAX_INPUT_RATE
)
b_reject
=
true
;
b_reject
=
true
;
if
(
!
b_reject
)
/* Do not wait against unprotected date */
const
mtime_t
i_deadline
=
p_audio
->
start_date
-
AOUT_MAX_PREPARE_TIME
;
while
(
!
b_reject
&&
i_deadline
-
VLC_HARD_MIN_SLEEP
>
mdate
()
)
{
{
/* Wait if we are too early
vlc_mutex_lock
(
&
p_owner
->
lock
);
* FIXME that's plain ugly to do it here */
if
(
p_owner
->
b_flushing
||
p_dec
->
b_die
)
mwait
(
p_audio
->
start_date
-
AOUT_MAX_PREPARE_TIME
);
{
b_reject
=
true
;
vlc_mutex_unlock
(
&
p_owner
->
lock
);
break
;
}
vlc_cond_timedwait
(
&
p_owner
->
wait
,
&
p_owner
->
lock
,
i_deadline
);
vlc_mutex_unlock
(
&
p_owner
->
lock
);
}
if
(
!
b_reject
)
{
if
(
!
aout_DecPlay
(
p_aout
,
p_aout_input
,
p_audio
,
i_rate
)
)
if
(
!
aout_DecPlay
(
p_aout
,
p_aout_input
,
p_audio
,
i_rate
)
)
*
pi_played_sum
+=
1
;
*
pi_played_sum
+=
1
;
*
pi_lost_sum
+=
aout_DecGetResetLost
(
p_aout
,
p_aout_input
);
*
pi_lost_sum
+=
aout_DecGetResetLost
(
p_aout
,
p_aout_input
);
...
...
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