[FFmpeg-devel] AVC: Test if not consumed bytes are all 0

Michael Niedermayer michaelni
Sun Feb 15 14:16:50 CET 2009


On Sun, Feb 15, 2009 at 02:06:58PM +0100, Carl Eugen Hoyos wrote:
> Hi!
>
> Attached patch silences ffmpeg for some camera recorded files.
>
> Please comment, Carl Eugen

> Index: libavcodec/h264.c
> ===================================================================
> --- libavcodec/h264.c	(revision 17319)
> +++ libavcodec/h264.c	(working copy)
> @@ -7418,7 +7418,13 @@
>          }
>  
>          if (h->is_avc && (nalsize != consumed)){
> -            av_log(h->s.avctx, AV_LOG_ERROR, "AVC: Consumed only %d bytes instead of %d\n", consumed, nalsize);
> +            int i, debug_level = AV_LOG_DEBUG;
> +            for (i = consumed; i < nalsize; i++)
> +                if (buf[buf_index+i]){
> +                    debug_level = AV_LOG_ERROR;
> +                    break;
> +                }
> +            av_log(h->s.avctx, debug_level, "AVC: Consumed only %d bytes instead of %d\n", consumed, nalsize);
>              consumed= nalsize;
>          }
>  

ok without the unneeded "break"

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090215/1197c834/attachment.pgp>



More information about the ffmpeg-devel mailing list