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
cb925bf2
Commit
cb925bf2
authored
Mar 17, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder: avoid block_FifoWake()
parent
34b47be9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
4 deletions
+23
-4
src/input/decoder.c
src/input/decoder.c
+23
-4
No files found.
src/input/decoder.c
View file @
cb925bf2
...
@@ -125,6 +125,7 @@ struct decoder_owner_sys_t
...
@@ -125,6 +125,7 @@ struct decoder_owner_sys_t
}
pause
;
}
pause
;
/* Waiting */
/* Waiting */
bool
b_woken
;
bool
b_waiting
;
bool
b_waiting
;
bool
b_first
;
bool
b_first
;
bool
b_has_data
;
bool
b_has_data
;
...
@@ -545,7 +546,10 @@ void input_DecoderWait( decoder_t *p_dec )
...
@@ -545,7 +546,10 @@ void input_DecoderWait( decoder_t *p_dec )
vlc_mutex_lock
(
&
p_owner
->
lock
);
vlc_mutex_lock
(
&
p_owner
->
lock
);
while
(
!
p_owner
->
b_has_data
)
while
(
!
p_owner
->
b_has_data
)
{
{
block_FifoWake
(
p_owner
->
p_fifo
);
vlc_fifo_Lock
(
p_owner
->
p_fifo
);
p_owner
->
b_woken
=
true
;
vlc_fifo_Signal
(
p_owner
->
p_fifo
);
vlc_fifo_Unlock
(
p_owner
->
p_fifo
);
vlc_cond_wait
(
&
p_owner
->
wait_acknowledge
,
&
p_owner
->
lock
);
vlc_cond_wait
(
&
p_owner
->
wait_acknowledge
,
&
p_owner
->
lock
);
}
}
vlc_mutex_unlock
(
&
p_owner
->
lock
);
vlc_mutex_unlock
(
&
p_owner
->
lock
);
...
@@ -744,6 +748,7 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
...
@@ -744,6 +748,7 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
es_format_Init
(
&
p_owner
->
fmt
,
UNKNOWN_ES
,
0
);
es_format_Init
(
&
p_owner
->
fmt
,
UNKNOWN_ES
,
0
);
/* decoder fifo */
/* decoder fifo */
p_owner
->
b_woken
=
false
;
p_owner
->
p_fifo
=
block_FifoNew
();
p_owner
->
p_fifo
=
block_FifoNew
();
if
(
unlikely
(
p_owner
->
p_fifo
==
NULL
)
)
if
(
unlikely
(
p_owner
->
p_fifo
==
NULL
)
)
{
{
...
@@ -865,10 +870,24 @@ static void *DecoderThread( void *p_data )
...
@@ -865,10 +870,24 @@ static void *DecoderThread( void *p_data )
/* The decoder's main loop */
/* The decoder's main loop */
for
(
;;
)
for
(
;;
)
{
{
block_t
*
p_block
=
block_FifoGet
(
p_owner
->
p_fifo
)
;
block_t
*
p_block
;
vlc_fifo_Lock
(
p_owner
->
p_fifo
);
vlc_fifo_CleanupPush
(
p_owner
->
p_fifo
);
while
(
vlc_fifo_IsEmpty
(
p_owner
->
p_fifo
)
)
{
if
(
p_owner
->
b_woken
)
break
;
vlc_fifo_Wait
(
p_owner
->
p_fifo
);
/* Make sure there is no cancellation point other than this one^^.
/* Make sure there is no cancellation point other than this one^^.
* If you need one, be sure to push cleanup of p_block. */
* If you need one, be sure to push cleanup of p_block. */
}
p_block
=
vlc_fifo_DequeueUnlocked
(
p_owner
->
p_fifo
);
p_owner
->
b_woken
=
false
;
vlc_cleanup_run
();
bool
end_wait
=
!
p_block
||
p_block
->
i_flags
&
BLOCK_FLAG_CORE_EOS
;
bool
end_wait
=
!
p_block
||
p_block
->
i_flags
&
BLOCK_FLAG_CORE_EOS
;
DecoderSignalWait
(
p_dec
,
end_wait
);
DecoderSignalWait
(
p_dec
,
end_wait
);
...
...
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