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
557eaa06
Commit
557eaa06
authored
Mar 21, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder: drain the audio output properly
parent
90a41800
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
src/input/decoder.c
src/input/decoder.c
+16
-3
No files found.
src/input/decoder.c
View file @
557eaa06
...
@@ -113,6 +113,7 @@ struct decoder_owner_sys_t
...
@@ -113,6 +113,7 @@ struct decoder_owner_sys_t
/* Flushing */
/* Flushing */
bool
b_flushing
;
bool
b_flushing
;
bool
b_draining
;
bool
b_draining
;
bool
b_drained
;
bool
b_idle
;
bool
b_idle
;
/* CC */
/* CC */
...
@@ -1423,7 +1424,6 @@ static void *DecoderThread( void *p_data )
...
@@ -1423,7 +1424,6 @@ static void *DecoderThread( void *p_data )
vlc_fifo_Lock
(
p_owner
->
p_fifo
);
vlc_fifo_Lock
(
p_owner
->
p_fifo
);
vlc_fifo_CleanupPush
(
p_owner
->
p_fifo
);
vlc_fifo_CleanupPush
(
p_owner
->
p_fifo
);
vlc_cond_signal
(
&
p_owner
->
wait_acknowledge
);
vlc_cond_signal
(
&
p_owner
->
wait_fifo
);
vlc_cond_signal
(
&
p_owner
->
wait_fifo
);
while
(
vlc_fifo_IsEmpty
(
p_owner
->
p_fifo
)
)
while
(
vlc_fifo_IsEmpty
(
p_owner
->
p_fifo
)
)
...
@@ -1447,6 +1447,18 @@ static void *DecoderThread( void *p_data )
...
@@ -1447,6 +1447,18 @@ static void *DecoderThread( void *p_data )
int
canc
=
vlc_savecancel
();
int
canc
=
vlc_savecancel
();
DecoderProcess
(
p_dec
,
p_block
);
DecoderProcess
(
p_dec
,
p_block
);
vlc_mutex_lock
(
&
p_owner
->
lock
);
if
(
p_block
==
NULL
)
{
/* Draining: the decoder is drained and all decoded buffers are
* queued to the output at this point. Now drain the output. */
if
(
p_owner
->
p_aout
!=
NULL
)
aout_DecFlush
(
p_owner
->
p_aout
,
true
);
}
p_owner
->
b_drained
=
(
p_block
==
NULL
);
vlc_cond_signal
(
&
p_owner
->
wait_acknowledge
);
vlc_mutex_unlock
(
&
p_owner
->
lock
);
vlc_restorecancel
(
canc
);
vlc_restorecancel
(
canc
);
}
}
return
NULL
;
return
NULL
;
...
@@ -1600,6 +1612,7 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
...
@@ -1600,6 +1612,7 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
p_owner
->
b_flushing
=
false
;
p_owner
->
b_flushing
=
false
;
p_owner
->
b_draining
=
false
;
p_owner
->
b_draining
=
false
;
p_owner
->
b_drained
=
false
;
p_owner
->
b_idle
=
false
;
p_owner
->
b_idle
=
false
;
/* */
/* */
...
@@ -1890,8 +1903,8 @@ bool input_DecoderIsEmpty( decoder_t * p_dec )
...
@@ -1890,8 +1903,8 @@ bool input_DecoderIsEmpty( decoder_t * p_dec )
vlc_mutex_lock
(
&
p_owner
->
lock
);
vlc_mutex_lock
(
&
p_owner
->
lock
);
if
(
p_owner
->
fmt
.
i_cat
==
VIDEO_ES
&&
p_owner
->
p_vout
!=
NULL
)
if
(
p_owner
->
fmt
.
i_cat
==
VIDEO_ES
&&
p_owner
->
p_vout
!=
NULL
)
b_empty
=
vout_IsEmpty
(
p_owner
->
p_vout
);
b_empty
=
vout_IsEmpty
(
p_owner
->
p_vout
);
else
if
(
p_owner
->
fmt
.
i_cat
==
AUDIO_ES
&&
p_owner
->
p_aout
!=
NULL
)
else
if
(
p_owner
->
fmt
.
i_cat
==
AUDIO_ES
)
b_empty
=
aout_DecIsEmpty
(
p_owner
->
p_aout
)
;
b_empty
=
p_owner
->
b_drained
;
else
else
b_empty
=
true
;
/* TODO subtitles support */
b_empty
=
true
;
/* TODO subtitles support */
vlc_mutex_unlock
(
&
p_owner
->
lock
);
vlc_mutex_unlock
(
&
p_owner
->
lock
);
...
...
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