Commit adbdca2e authored by Steve Lhomme's avatar Steve Lhomme
Browse files

video_output: tell ThreadDisplayPreparePicture if we want to drain fully or not

In full draining we don't use already decoded pictures, only pictures drained
from the filters.
parent 99d9bf5e
......@@ -1102,13 +1102,13 @@ static bool DropLate(vout_thread_sys_t *vout, picture_t *decoded, bool can_drop_
/* */
VLC_USED
static picture_t *ThreadGetPrerenderedLocked(vout_thread_sys_t *vout, bool reuse_decoded,
bool can_drop_late, bool *paused)
bool can_drop_late, bool *paused, bool drain_fully)
{
vout_thread_sys_t *sys = vout;
picture_t *picture = NULL;
while (!picture) {
picture = filter_chain_VideoDrain(sys->filter.chain_static, false);
picture = filter_chain_VideoDrain(sys->filter.chain_static, drain_fully);
if (picture && DropLate(vout, picture, can_drop_late, paused))
{
picture = NULL;
......@@ -1116,7 +1116,10 @@ static picture_t *ThreadGetPrerenderedLocked(vout_thread_sys_t *vout, bool reuse
}
if (picture)
break;
if (drain_fully)
break;
// here the chain_static is drained of pending pictures
picture_t *decoded;
if (reuse_decoded && sys->displayed.decoded) {
decoded = picture_Hold(sys->displayed.decoded);
......@@ -1496,7 +1499,7 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
{
assert(!sys->displayed.next);
sys->displayed.current =
ThreadGetPrerenderedLocked(vout, true, !frame_by_frame, &paused);
ThreadGetPrerenderedLocked(vout, true, !frame_by_frame, &paused, false);
if (!sys->displayed.current || frame_by_frame)
{
vlc_mutex_unlock(&sys->filter.lock);
......@@ -1510,7 +1513,7 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
if (!sys->displayed.next)
{
sys->displayed.next =
ThreadGetPrerenderedLocked(vout, false, false, &paused);
ThreadGetPrerenderedLocked(vout, false, false, &paused, false);
}
vlc_mutex_unlock(&sys->filter.lock);
......@@ -1527,7 +1530,7 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
if (!sys->displayed.next)
{
sys->displayed.next =
ThreadGetPrerenderedLocked(vout, false, true, &paused);
ThreadGetPrerenderedLocked(vout, false, true, &paused, false);
}
}
vlc_mutex_unlock(&sys->filter.lock);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment