diff mencoder.c @ 20902:bfb6eacd9c4a

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).
author uau
date Tue, 14 Nov 2006 12:29:20 +0000
parents 6289755ce7c7
children b42f1c1ef651
line wrap: on
line diff
--- a/mencoder.c	Tue Nov 14 11:14:03 2006 +0000
+++ b/mencoder.c	Tue Nov 14 12:29:20 2006 +0000
@@ -1322,8 +1322,9 @@
     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 @@
 
         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,