changeset 13593:e2dca00374f2

add new control message, that is send after end of stream, to flush all remaining frames in the video system required by xvid4 encoder.
author iive
date Sat, 09 Oct 2004 13:07:18 +0000
parents 970eef87a388
children acfe017b6195
files libmpcodecs/vf.h mencoder.c
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf.h	Sat Oct 09 08:11:16 2004 +0000
+++ b/libmpcodecs/vf.h	Sat Oct 09 13:07:18 2004 +0000
@@ -66,6 +66,7 @@
 #define VFCTRL_FLIP_PAGE 10 /* Tell the vo to flip pages */
 #define VFCTRL_DUPLICATE_FRAME 11 /* For encoding - encode zero-change frame */
 #define VFCTRL_SKIP_NEXT_FRAME 12 /* For encoding - drop the next frame that passes thru */
+#define VFCTRL_FLUSH_FRAMES    13 /* For encoding - flush delayed frames */
 
 #include "vfcap.h"
 
--- a/mencoder.c	Sat Oct 09 08:11:16 2004 +0000
+++ b/mencoder.c	Sat Oct 09 13:07:18 2004 +0000
@@ -1573,6 +1573,14 @@
 
 } // while(!at_eof)
 
+/* Emit the remaining frames in the video system */
+/*TODO emit frmaes delayed by decoder lag*/
+    if(sh_video && sh_video->vfilter){ 
+        mp_msg(MSGT_FIXME, MSGL_FIXME, "\nFlushing video frames\n");
+        ((vf_instance_t *)sh_video->vfilter)->control(sh_video->vfilter,
+                                                    VFCTRL_FLUSH_FRAMES, 0);
+    }
+
 #ifdef HAVE_MP3LAME
 // fixup CBR mp3 audio header:
 if(sh_audio && mux_a->codec==ACODEC_VBRMP3 && !lame_param_vbr){