From a703241aa9774c0a4024ab8fd7384088f8874f91 Mon Sep 17 00:00:00 2001 From: uau Date: Tue, 14 Nov 2006 12:29:20 +0000 Subject: Update OSD contents only after the correct values for the frame are known. The most visible inaccuracy caused by the previous update location was that the OSD always showed position 0 after seeking with demux_mkv. Split frame decoding and filtering because with -correct-pts the pts value that should be displayed for the frame is only known after decoding but is needed before filtering (during which the OSD is drawn). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20918 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mencoder.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mencoder.c') diff --git a/mencoder.c b/mencoder.c index 350dc02110..472a1ef3bb 100644 --- a/mencoder.c +++ b/mencoder.c @@ -1322,8 +1322,9 @@ case VCODEC_FRAMENO: break; default: // decode_video will callback down to ve_*.c encoders, through the video filters - blit_frame=decode_video(sh_video,frame_data.start,frame_data.in_size, + {void *decoded_frame = decode_video(sh_video,frame_data.start,frame_data.in_size, skip_flag>0 && (!sh_video->vfilter || ((vf_instance_t *)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);} if (sh_video->vf_inited < 0) mencoder_exit(1, NULL); @@ -1696,7 +1697,9 @@ static int slowseek(float end_pts, demux_stream_t *d_video, demux_stream_t *d_au if (vfilter) { int softskip = (vfilter->control(vfilter, VFCTRL_SKIP_NEXT_FRAME, 0) == CONTROL_TRUE); - decode_video(sh_video, frame_data->start, frame_data->in_size, !softskip, MP_NOPTS_VALUE); + 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); } if (print_info) mp_msg(MSGT_MENCODER, MSGL_STATUS, -- cgit v1.2.3