diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-10-04 04:13:32 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-10-04 04:16:28 +0200 |
commit | dd968a2edf0c07562ae8fac37702880d04fc21c5 (patch) | |
tree | 6ec82ffdabfc13ff03e294eaf465177dbe629711 /libavcodec/cinepak.c | |
parent | 2f9d6ffda78725e11b351a7a5d69414a32010810 (diff) | |
download | ffmpeg-dd968a2edf0c07562ae8fac37702880d04fc21c5.tar.gz |
cinepak: detect keyframes
Code by DivX, Inc.
Taken from drffmpeg
Author: unknown
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/cinepak.c')
-rw-r--r-- | libavcodec/cinepak.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c index 5a1ccd885d..a0ec7b89d0 100644 --- a/libavcodec/cinepak.c +++ b/libavcodec/cinepak.c @@ -355,6 +355,8 @@ static int cinepak_decode (CinepakContext *s) if (num_strips > MAX_STRIPS) num_strips = MAX_STRIPS; + s->frame.key_frame = 0; + for (i=0; i < num_strips; i++) { if ((s->data + 12) > eod) return -1; @@ -365,6 +367,9 @@ static int cinepak_decode (CinepakContext *s) s->strips[i].y2 = y0 + AV_RB16 (&s->data[8]); s->strips[i].x2 = s->avctx->width; + if (s->strips[i].id == 0x10) + s->frame.key_frame = 1; + strip_size = AV_RB24 (&s->data[1]) - 12; s->data += 12; strip_size = ((s->data + strip_size) > eod) ? (eod - s->data) : strip_size; |