Browse Source

vout: return the last displayed pts when flushed

work/string-cache
Thomas Guillem 5 months ago
committed by Jean-Baptiste Kempf
parent
commit
f1f13c456d
  1. 4
      include/vlc_vout.h
  2. 5
      src/video_output/video_output.c

4
include/vlc_vout.h

@ -148,8 +148,10 @@ VLC_API void vout_FlushSubpictureChannel( vout_thread_t *, size_t );
/**
* This function will ensure that all ready/displayed pictures have at most
* the provided date.
*
* @return the last displayed pts before flush
*/
VLC_API void vout_Flush( vout_thread_t *p_vout, vlc_tick_t i_date );
VLC_API vlc_tick_t vout_Flush( vout_thread_t *p_vout, vlc_tick_t i_date );
/**
* Empty all the pending pictures in the vout

5
src/video_output/video_output.c

@ -1744,18 +1744,21 @@ static void vout_FlushUnlocked(vout_thread_sys_t *vout, bool below,
sys->first_picture = true;
}
void vout_Flush(vout_thread_t *vout, vlc_tick_t date)
vlc_tick_t vout_Flush(vout_thread_t *vout, vlc_tick_t date)
{
vout_thread_sys_t *sys = VOUT_THREAD_TO_SYS(vout);
assert(!sys->dummy);
vout_control_Hold(&sys->control);
vout_FlushUnlocked(sys, false, date);
vlc_tick_t displayed_pts = sys->displayed.timestamp;
vout_control_Release(&sys->control);
struct vlc_tracer *tracer = GetTracer(sys);
if (tracer != NULL)
vlc_tracer_TraceEvent(tracer, "RENDER", sys->str_id, "flushed");
return displayed_pts;
}
void vout_NextPicture(vout_thread_t *vout)

Loading…
Cancel
Save