# HG changeset patch # User conrad # Date 1260649126 0 # Node ID c1328f04458a613ea3583aa832f432c00573b81f # Parent fe3cdc16514b9567d4742025b68c806a44ef2698 libtheoraenc.c: mark keyframes diff -r fe3cdc16514b -r c1328f04458a libtheoraenc.c --- a/libtheoraenc.c Sat Dec 12 19:44:01 2009 +0000 +++ b/libtheoraenc.c Sat Dec 12 20:18:46 2009 +0000 @@ -46,6 +46,7 @@ int stats_offset; int uv_hshift; int uv_vshift; + int keyframe_mask; } TheoraContext; /*! @@ -218,6 +219,7 @@ return -1; } + h->keyframe_mask = (1 << t_info.keyframe_granule_shift) - 1; /* Clear up theora_info struct */ th_info_clear(&t_info); @@ -336,6 +338,7 @@ // HACK: does not take codec delay into account (neither does the decoder though) avc_context->coded_frame->pts = frame->pts; + avc_context->coded_frame->key_frame = !(o_packet.granulepos & h->keyframe_mask); return o_packet.bytes; }