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
1110e12a
Commit
1110e12a
authored
Nov 17, 2015
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder: don't wait for flush to complete
parent
32040fdc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
22 deletions
+10
-22
src/input/decoder.c
src/input/decoder.c
+10
-22
No files found.
src/input/decoder.c
View file @
1110e12a
...
@@ -110,7 +110,6 @@ struct decoder_owner_sys_t
...
@@ -110,7 +110,6 @@ struct decoder_owner_sys_t
/* Flushing */
/* Flushing */
bool
flushing
;
bool
flushing
;
bool
flushed
;
bool
b_draining
;
bool
b_draining
;
atomic_bool
drained
;
atomic_bool
drained
;
bool
b_idle
;
bool
b_idle
;
...
@@ -1341,9 +1340,6 @@ static void *DecoderThread( void *p_data )
...
@@ -1341,9 +1340,6 @@ static void *DecoderThread( void *p_data )
if
(
unlikely
(
dummy
==
NULL
)
)
if
(
unlikely
(
dummy
==
NULL
)
)
msg_Err
(
p_dec
,
"cannot flush"
);
msg_Err
(
p_dec
,
"cannot flush"
);
/* Owner is buggy if it queues data while flushing */
assert
(
vlc_fifo_IsEmpty
(
p_owner
->
p_fifo
)
);
p_owner
->
flushing
=
false
;
vlc_fifo_Unlock
(
p_owner
->
p_fifo
);
vlc_fifo_Unlock
(
p_owner
->
p_fifo
);
/* Flush the decoder (and the output) */
/* Flush the decoder (and the output) */
...
@@ -1352,11 +1348,11 @@ static void *DecoderThread( void *p_data )
...
@@ -1352,11 +1348,11 @@ static void *DecoderThread( void *p_data )
vlc_fifo_Lock
(
p_owner
->
p_fifo
);
vlc_fifo_Lock
(
p_owner
->
p_fifo
);
vlc_restorecancel
(
canc
);
vlc_restorecancel
(
canc
);
/*
Owner is supposed to wait for flush to complete.
/*
Reset flushing after DecoderProcess in case input_DecoderFlush
*
TODO: It might be possible to remove this restriction. */
*
is called again. This will avoid a second useless flush (but
assert
(
vlc_fifo_IsEmpty
(
p_owner
->
p_fifo
)
);
* harmless). */
p_owner
->
flush
ed
=
tru
e
;
p_owner
->
flush
ing
=
fals
e
;
vlc_cond_signal
(
&
p_owner
->
wait_fifo
);
continue
;
continue
;
}
}
...
@@ -1486,7 +1482,6 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
...
@@ -1486,7 +1482,6 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
p_owner
->
b_has_data
=
false
;
p_owner
->
b_has_data
=
false
;
p_owner
->
flushing
=
false
;
p_owner
->
flushing
=
false
;
p_owner
->
flushed
=
true
;
p_owner
->
b_draining
=
false
;
p_owner
->
b_draining
=
false
;
atomic_init
(
&
p_owner
->
drained
,
false
);
atomic_init
(
&
p_owner
->
drained
,
false
);
p_owner
->
b_idle
=
false
;
p_owner
->
b_idle
=
false
;
...
@@ -1818,7 +1813,6 @@ void input_DecoderDecode( decoder_t *p_dec, block_t *p_block, bool b_do_pace )
...
@@ -1818,7 +1813,6 @@ void input_DecoderDecode( decoder_t *p_dec, block_t *p_block, bool b_do_pace )
vlc_fifo_WaitCond
(
p_owner
->
p_fifo
,
&
p_owner
->
wait_fifo
);
vlc_fifo_WaitCond
(
p_owner
->
p_fifo
,
&
p_owner
->
wait_fifo
);
}
}
p_owner
->
flushed
=
false
;
vlc_fifo_QueueUnlocked
(
p_owner
->
p_fifo
,
p_block
);
vlc_fifo_QueueUnlocked
(
p_owner
->
p_fifo
,
p_block
);
vlc_fifo_Unlock
(
p_owner
->
p_fifo
);
vlc_fifo_Unlock
(
p_owner
->
p_fifo
);
}
}
...
@@ -1874,15 +1868,13 @@ void input_DecoderFlush( decoder_t *p_dec )
...
@@ -1874,15 +1868,13 @@ void input_DecoderFlush( decoder_t *p_dec )
vlc_fifo_Lock
(
p_owner
->
p_fifo
);
vlc_fifo_Lock
(
p_owner
->
p_fifo
);
/* Don't flush if already flushed */
if
(
p_owner
->
flushed
)
{
vlc_fifo_Unlock
(
p_owner
->
p_fifo
);
return
;
}
/* Empty the fifo */
/* Empty the fifo */
block_ChainRelease
(
vlc_fifo_DequeueAllUnlocked
(
p_owner
->
p_fifo
)
);
block_ChainRelease
(
vlc_fifo_DequeueAllUnlocked
(
p_owner
->
p_fifo
)
);
/* Don't need to wait for the DecoderThread to flush. Indeed, if called a
* second time, this function will clear the FIFO again before anything was
* dequeued by DecoderThread and there is no need to flush a second time in
* a row. */
p_owner
->
flushing
=
true
;
p_owner
->
flushing
=
true
;
/* Flushing video decoder when paused: increment frames_countdown in order
/* Flushing video decoder when paused: increment frames_countdown in order
...
@@ -1894,10 +1886,6 @@ void input_DecoderFlush( decoder_t *p_dec )
...
@@ -1894,10 +1886,6 @@ void input_DecoderFlush( decoder_t *p_dec )
vlc_fifo_Signal
(
p_owner
->
p_fifo
);
vlc_fifo_Signal
(
p_owner
->
p_fifo
);
}
}
/* Monitor for flush end */
while
(
!
p_owner
->
flushed
)
vlc_fifo_WaitCond
(
p_owner
->
p_fifo
,
&
p_owner
->
wait_fifo
);
vlc_fifo_Unlock
(
p_owner
->
p_fifo
);
vlc_fifo_Unlock
(
p_owner
->
p_fifo
);
}
}
...
...
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