mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
cinepak: detect keyframes
Code by DivX, Inc. Taken from drffmpeg Author: unknown Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
2f9d6ffda7
commit
dd968a2edf
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user