From 7306f6e2c1384fc018db33a7cfee1cd986cb79bc Mon Sep 17 00:00:00 2001 From: iive Date: Sun, 17 Oct 2004 17:59:38 +0000 Subject: [PATCH] Mark I-frames as seekable only if we encode with one reference frame, IDR are always seekable patch send by Loren Merritt git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13659 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ve_x264.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libmpcodecs/ve_x264.c b/libmpcodecs/ve_x264.c index 7b3584cf00..ab1f5147c6 100644 --- a/libmpcodecs/ve_x264.c +++ b/libmpcodecs/ve_x264.c @@ -304,7 +304,9 @@ static int put_image(struct vf_instance_s *vf, mp_image_t *mpi) i_size += x264_nal_encode(mod->mux->buffer + i_size, &i_data, 1, &nal[i]); } if(i_size>0) { - muxer_write_chunk(mod->mux, i_size, (mod->pic.i_type == X264_TYPE_I)?0x10:0); + int keyframe = (mod->pic.i_type == X264_TYPE_IDR) || + (mod->pic.i_type == X264_TYPE_I && frame_ref == 1); + muxer_write_chunk(mod->mux, i_size, keyframe?0x10:0); } return 1; }