typedef struct VP9ParseContext {
int n_frames; // 1-8
int size[8];
+ int64_t pts;
} VP9ParseContext;
static void parse_frame(AVCodecParserContext *ctx, const uint8_t *buf, int size)
{
+ VP9ParseContext *s = ctx->priv_data;
+
if (buf[0] & 0x4) {
ctx->pict_type = AV_PICTURE_TYPE_P;
ctx->key_frame = 0;
ctx->pict_type = AV_PICTURE_TYPE_I;
ctx->key_frame = 1;
}
+
+ if (buf[0] & 0x2) {
+ if (ctx->pts == AV_NOPTS_VALUE)
+ ctx->pts = s->pts;
+ s->pts = AV_NOPTS_VALUE;
+ } else {
+ s->pts = ctx->pts;
+ ctx->pts = AV_NOPTS_VALUE;
+ }
}
static int parse(AVCodecParserContext *ctx,