Commit 53962ff6 authored by cehoyos's avatar cehoyos

Set context variable key_frame in H264 parser.

Patch by Ivan Schreter, schreter gmx net


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@17489 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 5079df10
......@@ -118,8 +118,10 @@ static inline int parse_nal_units(AVCodecParserContext *s,
/* 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(AVCodecParserContext *s,
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment