1 diff -Naur ffmpeg-r19067.orig/libavcodec/h264.c ffmpeg-r19067/libavcodec/h264.c
2 --- ffmpeg-r19067.orig/libavcodec/h264.c 2009-05-29 20:24:20.000000000 -0400
3 +++ ffmpeg-r19067/libavcodec/h264.c 2009-06-01 12:45:16.000000000 -0400
5 * stream. Need to discard one frame. Prevents overrun of the
6 * short_ref and long_ref buffers.
8 - av_log(h->s.avctx, AV_LOG_ERROR,
9 + av_log(h->s.avctx, AV_LOG_DEBUG,
10 "number of reference frames exceeds max (probably "
11 "corrupt input), discarding one\n");
15 if(!(s->flags2 & CODEC_FLAG2_CHUNKS) && !s->current_picture_ptr){
16 if (avctx->skip_frame >= AVDISCARD_NONREF || s->hurry_up) return 0;
17 - av_log(avctx, AV_LOG_ERROR, "no frame!\n");
18 + av_log(avctx, AV_LOG_DEBUG, "no frame!\n");
22 diff -Naur ffmpeg-r19067.orig/libavcodec/mpegvideo.c ffmpeg-r19067/libavcodec/mpegvideo.c
23 --- ffmpeg-r19067.orig/libavcodec/mpegvideo.c 2009-05-27 15:55:35.000000000 -0400
24 +++ ffmpeg-r19067/libavcodec/mpegvideo.c 2009-06-01 12:45:16.000000000 -0400
28 av_log(s->avctx, AV_LOG_FATAL, "Internal error, picture buffer overflow\n");
29 - /* We could return -1, but the codec would crash trying to draw into a
30 - * non-existing frame anyway. This is safer than waiting for a random crash.
31 - * Also the return of this is never useful, an encoder must only allocate
32 - * as much as allowed in the specification. This has no relationship to how
33 - * much libavcodec could allocate (and MAX_PICTURE_COUNT is always large
34 - * enough for such valid streams).
35 - * Plus, a decoder has to check stream validity and remove frames if too
36 - * many reference frames are around. Waiting for "OOM" is not correct at
37 - * all. Similarly, missing reference frames have to be replaced by
38 - * interpolated/MC frames, anything else is a bug in the codec ...
42 + /* XXX there seems to be a leak caused by h264 in mpeg transport
43 + * streams: Over-the-air streams have a lot of errors. A picture
44 + * may be marked as referenced but the actual references get lost
45 + * so it never gets released. We take care of that here by releasing
46 + * the oldest we have & reusing its slot. */
48 + for(i=0; i<MAX_PICTURE_COUNT; i++){
49 + if (s->picture[i].coded_picture_number < s->picture[oldest].coded_picture_number)
52 + s->avctx->release_buffer(s->avctx, (AVFrame*)&s->picture[oldest]);
56 static void update_noise_reduction(MpegEncContext *s){