# HG changeset patch # User arpi_esp # Date 1017356874 0 # Node ID e20de99b62959e26c690e5970800fa66a8eb555b # Parent a1234c032636b5c9972271bcf4d06d9870eecb38 using Juanjo's way to pass forced type - especially as I_TYPE/P_TYPE defines aren't exported in the public interface, and the flagged method matches the way as qscale forcing work diff -r a1234c032636 -r e20de99b6295 avcodec.h --- a/avcodec.h Thu Mar 28 22:50:22 2002 +0000 +++ b/avcodec.h Thu Mar 28 23:07:54 2002 +0000 @@ -69,6 +69,7 @@ #define CODEC_FLAG_B 0x0008 /* use B frames */ #define CODEC_FLAG_QPEL 0x0010 /* use qpel MC */ #define CODEC_FLAG_GMC 0x0020 /* use GMC */ +#define CODEC_FLAG_TYPE 0x0040 /* fixed I/P frame type, from avctx->key_frame */ /* codec capabilities */ @@ -121,8 +122,6 @@ int qmax; /* max qscale */ int max_qdiff; /* max qscale difference between frames */ - int force_type; /* 0= no force, otherwise I_TYPE, P_TYPE, ... */ - struct AVCodec *codec; void *priv_data; diff -r a1234c032636 -r e20de99b6295 mpegvideo.c --- a/mpegvideo.c Thu Mar 28 22:50:22 2002 +0000 +++ b/mpegvideo.c Thu Mar 28 23:07:54 2002 +0000 @@ -514,7 +514,8 @@ init_put_bits(&s->pb, buf, buf_size, NULL, NULL); - s->force_type= avctx->force_type; + s->force_type= (avctx->flags&CODEC_FLAG_TYPE) ? + (avctx->key_frame ? I_TYPE : P_TYPE) : 0; if (!s->intra_only) { /* first picture of GOP is intra */ if (s->picture_in_gop_number % s->gop_size==0 || s->force_type==I_TYPE){