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

video_output: handle draining of interactive filters before using prerendered pics

Interactive/User filters are allowed to output more than one frame at a time.
(it could also be deinterlacers or fps filters added manually)

This introduces some timing differences in the processing time we use to adjust
the estimated display time. The drain may be faster or slower than the regular
filtering call.

Filter (chains) that only output one picture at the time won't be affected.

Before this patch, extra pictures from interactive filters were simply dropped
and never displayed.
parent 1aa633f0
......@@ -1227,15 +1227,22 @@ static int ThreadDisplayRenderPicture(vout_thread_sys_t *vout, bool render_now)
{
vout_thread_sys_t *sys = vout;
// hold it as the filter chain will release it or return it and we release it
picture_Hold(sys->displayed.current);
vout_chrono_Start(&sys->render);
vlc_mutex_lock(&sys->filter.lock);
picture_t *filtered = filter_chain_VideoFilter(sys->filter.chain_interactive, sys->displayed.current);
picture_t *filtered = filter_chain_VideoFilter(sys->filter.chain_interactive, NULL);
vlc_mutex_unlock(&sys->filter.lock);
if (filtered == NULL)
{
// hold it as the filter chain will release it or return it and we release it
picture_Hold(sys->displayed.current);
vlc_mutex_lock(&sys->filter.lock);
filtered = filter_chain_VideoFilter(sys->filter.chain_interactive, sys->displayed.current);
vlc_mutex_unlock(&sys->filter.lock);
}
if (!filtered)
return VLC_EGENERIC;
......
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