[FFmpeg-cvslog] r17489 - trunk/libavcodec/h264_parser.c
cehoyos
subversion
Sat Feb 21 20:59:26 CET 2009
Author: cehoyos
Date: Sat Feb 21 20:59:25 2009
New Revision: 17489
Log:
Set context variable key_frame in H264 parser.
Patch by Ivan Schreter, schreter gmx net
Modified:
trunk/libavcodec/h264_parser.c
Modified: trunk/libavcodec/h264_parser.c
==============================================================================
--- trunk/libavcodec/h264_parser.c Sat Feb 21 20:56:50 2009 (r17488)
+++ trunk/libavcodec/h264_parser.c Sat Feb 21 20:59:25 2009 (r17489)
@@ -118,8 +118,10 @@ static inline int parse_nal_units(AVCode
/* set some sane default values */
s->pict_type = FF_I_TYPE;
+ s->key_frame = 0;
h->s.avctx= avctx;
+ h->sei_recovery_frame_cnt = -1;
for(;;) {
int src_length, dst_length, consumed;
@@ -152,10 +154,16 @@ static inline int parse_nal_units(AVCode
ff_h264_decode_sei(h);
break;
case NAL_IDR_SLICE:
+ s->key_frame = 1;
+ /* fall through */
case NAL_SLICE:
get_ue_golomb(&h->s.gb); // skip first_mb_in_slice
slice_type = get_ue_golomb_31(&h->s.gb);
s->pict_type = golomb_to_pict_type[slice_type % 5];
+ if (h->sei_recovery_frame_cnt >= 0) {
+ /* key frame, since recovery_frame_cnt is set */
+ s->key_frame = 1;
+ }
return 0; /* no need to evaluate the rest */
}
buf += consumed;
More information about the ffmpeg-cvslog
mailing list