summaryrefslogtreecommitdiffstats
path: root/contrib/ffmpeg/A01-mpegleak.patch
diff options
context:
space:
mode:
authorkonablend <[email protected]>2009-03-01 17:03:11 +0000
committerkonablend <[email protected]>2009-03-01 17:03:11 +0000
commit4dbce6b69967c1e14092637aa95b6c31855a81fc (patch)
tree516c17095967698eeb419c70ce72dbd2c11bf754 /contrib/ffmpeg/A01-mpegleak.patch
parentc47939541ccec1e5e57753b16b28baed2613f586 (diff)
BuildSystem: conversion from jam-based to make-based system.
KNOWN ISSUES: 1. OSX + Xcode builds do not support parallel builds; attempting to use them may cause unbounded number of jobs. However, disabling via configure --disable-xcode avoids the issue. 2. OSX ppc binary produces binary which has audio-scan problems. 3. OSX ppc64 binary has not been runtime tested. ADDED: 00-BuildUserGuide.txt contrib/*/module.* doc/ make/ libhb/module.* test/module.* macos/module.* gtk/module.* DROPPED: BUILD BuildContribDarwin.sh DownloadMacOsXContribBinaries.sh Jamfile Jamrules MacOsXContribBinariesVersion.txt Makefile Makefile.config jam libhb/Jamefile libhb/Makefile test/BUILDSHARED test/Makefile contrib/Jamfile contrib/Makefile contrib/patch-ffmpeg.patch contrib/patch-x264-idr.patch contrib/patch-x264-linux.patch RENAMED: contrib/*.patch -> contrib/MODULE/[AP]??-*.patch macosx/HandBrake.plist -> macosx/Info.plist MODIFIED: libhb/decavcodec.c Patched to use cleaner include "libavcodec/audioconvert". Second part to support this cleanup is ffmpeg A02-audioconvert.patch . MODIFIED: libhb/hb.c MODIFIED: libhb/hb.h MODIFIED: libhb/muxmkv.c MODIFIED: libhb/muxmp4.c MODIFIED: libhb/update.c Patched to use "project.h" for project metadata. Renamed HB_BUILD -> HB_PROJECT_BUILD. Renamed HB_VERSION -> HB_PROJECT_VERSION. MODIFIED: test/test.c: Patched HandBrakeCLI to support I/O on Mac OS X ZFS filesystems. Reference r1803 as similar patch for HandBrake.app . Unpatched behavior is crash/buserror when using ZFS. MODIFIED: macosx/Growl.framework/ Upgraded 0.7.6 (i386,ppc) -> 1.1.2 (i386,x86_64,ppc,ppc64). New architectures facilitate x86_64 and ppc64 builds. MODIFIED: macosx/HandBrake.xcodeproj/ Bumped compatibilty mode from 2.4 -> 3.1 . Dumped old configurations Deployment, Developer. Added configurations standard, sebug as replacements. Added standard.i386, standard.x86_64, standard.ppc, standard.ppc64 . for explicit architecture build. All configurations settings cleaned up and normalized. Build output directories adjusted to support new build system. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2180 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'contrib/ffmpeg/A01-mpegleak.patch')
-rw-r--r--contrib/ffmpeg/A01-mpegleak.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/contrib/ffmpeg/A01-mpegleak.patch b/contrib/ffmpeg/A01-mpegleak.patch
new file mode 100644
index 000000000..36179ba57
--- /dev/null
+++ b/contrib/ffmpeg/A01-mpegleak.patch
@@ -0,0 +1,56 @@
+diff -Naur ffmpeg.orig/libavcodec/h264.c ffmpeg/libavcodec/h264.c
+--- ffmpeg.orig/libavcodec/h264.c 2008-12-01 11:24:19.000000000 -0500
++++ ffmpeg/libavcodec/h264.c 2009-02-21 08:23:58.000000000 -0500
+@@ -3298,7 +3298,7 @@
+ * stream. Need to discard one frame. Prevents overrun of the
+ * short_ref and long_ref buffers.
+ */
+- av_log(h->s.avctx, AV_LOG_ERROR,
++ av_log(h->s.avctx, AV_LOG_DEBUG,
+ "number of reference frames exceeds max (probably "
+ "corrupt input), discarding one\n");
+
+@@ -7556,7 +7556,7 @@
+
+ if(!(s->flags2 & CODEC_FLAG2_CHUNKS) && !s->current_picture_ptr){
+ if (avctx->skip_frame >= AVDISCARD_NONREF || s->hurry_up) return 0;
+- av_log(avctx, AV_LOG_ERROR, "no frame!\n");
++ av_log(avctx, AV_LOG_DEBUG, "no frame!\n");
+ return -1;
+ }
+
+diff -Naur ffmpeg.orig/libavcodec/mpegvideo.c ffmpeg/libavcodec/mpegvideo.c
+--- ffmpeg.orig/libavcodec/mpegvideo.c 2008-10-01 20:27:09.000000000 -0400
++++ ffmpeg/libavcodec/mpegvideo.c 2009-02-21 08:23:58.000000000 -0500
+@@ -779,19 +779,18 @@
+ }
+
+ av_log(s->avctx, AV_LOG_FATAL, "Internal error, picture buffer overflow\n");
+- /* We could return -1, but the codec would crash trying to draw into a
+- * non-existing frame anyway. This is safer than waiting for a random crash.
+- * Also the return of this is never useful, an encoder must only allocate
+- * as much as allowed in the specification. This has no relationship to how
+- * much libavcodec could allocate (and MAX_PICTURE_COUNT is always large
+- * enough for such valid streams).
+- * Plus, a decoder has to check stream validity and remove frames if too
+- * many reference frames are around. Waiting for "OOM" is not correct at
+- * all. Similarly, missing reference frames have to be replaced by
+- * interpolated/MC frames, anything else is a bug in the codec ...
+- */
+- abort();
+- return -1;
++ /* XXX there seems to be a leak caused by h264 in mpeg transport
++ * streams: Over-the-air streams have a lot of errors. A picture
++ * may be marked as referenced but the actual references get lost
++ * so it never gets released. We take care of that here by releasing
++ * the oldest we have & reusing its slot. */
++ int oldest=0;
++ for(i=0; i<MAX_PICTURE_COUNT; i++){
++ if (s->picture[i].coded_picture_number < s->picture[oldest].coded_picture_number)
++ oldest = i;
++ }
++ s->avctx->release_buffer(s->avctx, (AVFrame*)&s->picture[oldest]);
++ return oldest;
+ }
+
+ static void update_noise_reduction(MpegEncContext *s){