summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-09-23 12:26:44 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-09-23 12:26:44 +0000
commitde85aebe1ec10c85f064805e7e630301adb89775 (patch)
treecda6b25346c48cc29fc3e1daeedaa8bf6db67b0e /libmpcodecs
parent189361565643031d6d555f31b69129e7159f18ab (diff)
downloadmpv-de85aebe1ec10c85f064805e7e630301adb89775.tar.bz2
mpv-de85aebe1ec10c85f064805e7e630301adb89775.tar.xz
Use x264_encoder_delayed_frames instead of the current hack to flush delayed
frames in VFCTRL_FLUSH_FRAMES. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29705 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/ve_x264.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libmpcodecs/ve_x264.c b/libmpcodecs/ve_x264.c
index 01f87fd040..36a42406a5 100644
--- a/libmpcodecs/ve_x264.c
+++ b/libmpcodecs/ve_x264.c
@@ -196,12 +196,10 @@ 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:
- 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;