[FFmpeg-devel] [PATCH] H264 parser fix

Howard Chu hyc
Wed May 19 10:17:13 CEST 2010


Howard Chu wrote:
> When decoding an H264 stream that uses global headers, you get an endless
> stream of "non-existing PPS referenced" messages. This message comes from
> h264_parser.c, and it happens because it's using an H264Context hanging off
> the AVCodecParserContext, which is separate from the H264Context hanging off
> the AVCodecContext, and only the AVCodecContext contains the extradata that
> provides the PPS and SPS.
>
> This patch is admittedly a hack, but it stops the error. It just checks in the
> AVCodecContext if the PPS wasn't found in the AVCodecParserContext.
>
Dohh. Ignore this part:

> Index: libavcodec/pnm.c
> ===================================================================
> --- libavcodec/pnm.c	(revision 23169)
> +++ libavcodec/pnm.c	(working copy)
> @@ -134,6 +134,8 @@
>          return -1;
>      pnm_get(s, buf1, sizeof(buf1));
>      avctx->height = atoi(buf1);
> +    if (avctx->height <= 0)
> +        return -1;
>      if(avcodec_check_dimensions(avctx, avctx->width, avctx->height))
>          return -1;
>      if (avctx->pix_fmt != PIX_FMT_MONOWHITE) {

Sent by mistake, totally irrelevant.

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/



More information about the ffmpeg-devel mailing list