[MPlayer-cvslog] r29705 - trunk/libmpcodecs/ve_x264.c

reimar subversion at mplayerhq.hu
Wed Sep 23 14:26:44 CEST 2009


Author: reimar
Date: Wed Sep 23 14:26:44 2009
New Revision: 29705

Log:
Use x264_encoder_delayed_frames instead of the current hack to flush delayed
frames in VFCTRL_FLUSH_FRAMES.

Modified:
   trunk/libmpcodecs/ve_x264.c

Modified: trunk/libmpcodecs/ve_x264.c
==============================================================================
--- trunk/libmpcodecs/ve_x264.c	Wed Sep 23 14:01:04 2009	(r29704)
+++ trunk/libmpcodecs/ve_x264.c	Wed Sep 23 14:26:44 2009	(r29705)
@@ -196,12 +196,10 @@ static int config(struct vf_instance_s* 
 static int control(struct vf_instance_s* vf, int request, void *data)
 {
     h264_module_t *mod=(h264_module_t*)vf->priv;
-    int count = 256; // giant HACK, x264_encoder_encode may incorrectly return 0
-                     // when threads > 1 and delayed frames pending
     switch(request){
         case VFCTRL_FLUSH_FRAMES:
-            while(encode_frame(vf, NULL) == 0 && --count);
-                while(encode_frame(vf, NULL) > 0);
+            while (x264_encoder_delayed_frames(mod->x264) > 0)
+                encode_frame(vf, NULL);
             return CONTROL_TRUE;
         default:
             return CONTROL_UNKNOWN;


More information about the MPlayer-cvslog mailing list