diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-08-07 09:07:02 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-08-07 09:07:02 +0000 |
commit | a04ec2484b24957cafbb65a49540a40d21857a66 (patch) | |
tree | f74cd95d409751dff219252b71c1a1996c4c35bc /libmpcodecs | |
parent | d4419a78698d1c1c5f602f950699fa71cdbfdac9 (diff) | |
download | mpv-a04ec2484b24957cafbb65a49540a40d21857a66.tar.bz2 mpv-a04ec2484b24957cafbb65a49540a40d21857a66.tar.xz |
Add a giant hack to the x264 encoder module to ensure all delayed frames are
written on FLUSH_FRAMES, this is necessary since using multiple threads adds
an additional delay beyond the B-frame delay.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29480 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/ve_x264.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libmpcodecs/ve_x264.c b/libmpcodecs/ve_x264.c index 56bb5868df..8a4a1147f3 100644 --- a/libmpcodecs/ve_x264.c +++ b/libmpcodecs/ve_x264.c @@ -218,9 +218,11 @@ static int config(struct vf_instance_s* vf, int width, int height, int d_width, 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: - if(param.i_bframe) + while(encode_frame(vf, NULL) == 0 && --count); while(encode_frame(vf, NULL) > 0); return CONTROL_TRUE; default: |