mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-12 18:10:13 +01:00
mpegvideo: don't pretend the first frame is always a key frame
Signed-off-by: Wolfram Gloger <wmglo@dent.med.uni-muenchen.de> Modify the parser initialization so that parsers can set pict_type themselves. Use this in the mpegvideo parser so that initial frames are not unconditionally I frames. I have had this in my tree for several years. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
committed by
Michael Niedermayer
parent
6f9803e5e0
commit
f8353d5fda
@@ -182,9 +182,16 @@ static int mpegvideo_split(AVCodecContext *avctx,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mpegvideo_parse_init(AVCodecParserContext *s)
|
||||
{
|
||||
s->pict_type = AV_PICTURE_TYPE_NONE; // first frame might be partial
|
||||
return 0;
|
||||
}
|
||||
|
||||
AVCodecParser ff_mpegvideo_parser = {
|
||||
.codec_ids = { CODEC_ID_MPEG1VIDEO, CODEC_ID_MPEG2VIDEO },
|
||||
.priv_data_size = sizeof(struct MpvParseContext),
|
||||
.parser_init = mpegvideo_parse_init,
|
||||
.parser_parse = mpegvideo_parse,
|
||||
.parser_close = ff_parse_close,
|
||||
.split = mpegvideo_split,
|
||||
|
||||
Reference in New Issue
Block a user