1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-11 09:25:56 +00:00

Reuse the keyframe flag from x264 instead of trying to derive it on our own.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30790 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2010-02-28 07:52:34 +00:00
parent 4d08f30d25
commit e86ecdac03

View File

@ -258,10 +258,7 @@ static int encode_frame(struct vf_instance *vf, x264_picture_t *pic_in)
return -1;
}
if(i_size>0) {
int keyframe = (pic_out.i_type == X264_TYPE_IDR) ||
(pic_out.i_type == X264_TYPE_I
&& param.i_frame_reference == 1
&& !param.i_bframe);
int keyframe = pic_out.b_keyframe;
memcpy(mod->mux->buffer, nal->p_payload, i_size);
muxer_write_chunk(mod->mux, i_size, keyframe?AVIIF_KEYFRAME:0, MP_NOPTS_VALUE, MP_NOPTS_VALUE);
}