summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/ve_x264.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpcodecs/ve_x264.c')
-rw-r--r--libmpcodecs/ve_x264.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libmpcodecs/ve_x264.c b/libmpcodecs/ve_x264.c
index 51da237169..3a909cdfb7 100644
--- a/libmpcodecs/ve_x264.c
+++ b/libmpcodecs/ve_x264.c
@@ -218,9 +218,11 @@ static int config(struct vf_instance* vf, int width, int height, int d_width, in
static int control(struct vf_instance* 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:
- if(param.i_bframe)
+ while(encode_frame(vf, NULL) == 0 && --count);
while(encode_frame(vf, NULL) > 0);
return CONTROL_TRUE;
default: