From d419ecd161634e79dab3ac57d57c4bccba2adcdc Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Thu, 15 Jan 2009 01:07:12 +0200 Subject: OSD: Ensure that OSD content is drawn in filter-added frames Move the OSD drawing calls from filter_video() to higher-level code to ensure that VOs will draw the OSD also in filter-added frames, which are displayed without a separate call to filter_video(). --- mencoder.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'mencoder.c') diff --git a/mencoder.c b/mencoder.c index 52edeeac88..600afd1276 100644 --- a/mencoder.c +++ b/mencoder.c @@ -1346,7 +1346,13 @@ default: sh_video->vfilter->control(sh_video->vfilter, VFCTRL_SET_OSD_OBJ, osd); {void *decoded_frame = decode_video(sh_video,frame_data.start,frame_data.in_size, skip_flag>0 && (!sh_video->vfilter || sh_video->vfilter->control(sh_video->vfilter, VFCTRL_SKIP_NEXT_FRAME, 0) != CONTROL_TRUE), MP_NOPTS_VALUE); - blit_frame = decoded_frame && filter_video(sh_video, decoded_frame, MP_NOPTS_VALUE, osd);} + blit_frame = decoded_frame && filter_video(sh_video, decoded_frame, MP_NOPTS_VALUE); + if (blit_frame) { + struct vf_instance *vf = sh_video->vfilter; + vf->control(vf, VFCTRL_DRAW_EOSD, NULL); + vf->control(vf, VFCTRL_DRAW_OSD, osd); + } + } if (sh_video->vf_initialized < 0) mencoder_exit(1, NULL); @@ -1711,7 +1717,11 @@ static int slowseek(float end_pts, demux_stream_t *d_video, demux_stream_t *d_au int softskip = (vfilter->control(vfilter, VFCTRL_SKIP_NEXT_FRAME, 0) == CONTROL_TRUE); void *decoded_frame = decode_video(sh_video, frame_data->start, frame_data->in_size, !softskip, MP_NOPTS_VALUE); if (decoded_frame) - filter_video(sh_video, decoded_frame, MP_NOPTS_VALUE, osd); + if (filter_video(sh_video, decoded_frame, MP_NOPTS_VALUE)) { + struct vf_instance *vf = sh_video->vfilter; + vf->control(vf, VFCTRL_DRAW_EOSD, NULL); + vf->control(vf, VFCTRL_DRAW_OSD, osd); + } } if (print_info) mp_msg(MSGT_MENCODER, MSGL_STATUS, -- cgit v1.2.3