From 67efaf16d3a7daa176d2afab484871d9cbae9919 Mon Sep 17 00:00:00 2001 From: astrange Date: Tue, 6 Nov 2012 09:02:15 +0000 Subject: [PATCH] Restore needed patches against libav v0.8.4 Many crashes should now be fixed. The now deprecated APIs need to be removed so we can update again to v9 and past. Still need to add back the old patch #3 (hardcoded CPU detection) for binary size optimization. --- ...me-parts-of-h264.c-Perian-never-uses.patch | 31 ----------- ...UFFER_SIZE-to-fix-running-out-of-bu.patch} | 16 +++--- ...ng-Cannot-parallelize-deblocking-typ.patch | 29 ---------- ...I-audio-tracks-importing-1152x-too-.patch} | 12 ++--- ...-of-runtime-cpu-detection-in-dsputil.patch | 53 ------------------- ...6-Workaround-hang-issue-in-configure.patch | 35 ------------ createStaticLibs.sh | 8 +-- 7 files changed, 16 insertions(+), 168 deletions(-) delete mode 100644 Patches/0001-Disable-some-parts-of-h264.c-Perian-never-uses.patch rename Patches/{0004-Double-INTERNAL_BUFFER_SIZE-to-fix-running-out-of-bu.patch => 0001-Double-INTERNAL_BUFFER_SIZE-to-fix-running-out-of-bu.patch} (73%) delete mode 100644 Patches/0002-Remove-the-warning-Cannot-parallelize-deblocking-typ.patch rename Patches/{0005-Workaround-for-AVI-audio-tracks-importing-1152x-too-.patch => 0002-Workaround-for-AVI-audio-tracks-importing-1152x-too-.patch} (69%) delete mode 100644 Patches/0003-Hardcode-results-of-runtime-cpu-detection-in-dsputil.patch delete mode 100644 Patches/0006-Workaround-hang-issue-in-configure.patch diff --git a/Patches/0001-Disable-some-parts-of-h264.c-Perian-never-uses.patch b/Patches/0001-Disable-some-parts-of-h264.c-Perian-never-uses.patch deleted file mode 100644 index 9a27d07..0000000 --- a/Patches/0001-Disable-some-parts-of-h264.c-Perian-never-uses.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 8436c9527c8fb332d2134c05d4e7646754481fd5 Mon Sep 17 00:00:00 2001 -From: Alexander Strange -Date: Sun, 22 Nov 2009 04:07:00 -0500 -Subject: [PATCH 1/6] Disable some parts of h264.c Perian never uses. - -TODO: we can enable MBAFF, but I still see no way to support -PAFF in QuickTime, and I'm not even sure how it is supposed -to work in .mp4. ---- - libavcodec/h264.h | 5 ++++- - 1 files changed, 4 insertions(+), 1 deletions(-) - -diff --git a/libavcodec/h264.h b/libavcodec/h264.h -index 5280e51..99e1d6f 100644 ---- a/libavcodec/h264.h -+++ b/libavcodec/h264.h -@@ -48,7 +48,10 @@ - - /* Compiling in interlaced support reduces the speed - * of progressive decoding by about 2%. */ --#define ALLOW_INTERLACE -+//#define ALLOW_INTERLACE -+ -+#undef CODEC_FLAG2_CHUNKS -+#define CODEC_FLAG2_CHUNKS 0 - - #define FMO 0 - --- -1.7.8 - diff --git a/Patches/0004-Double-INTERNAL_BUFFER_SIZE-to-fix-running-out-of-bu.patch b/Patches/0001-Double-INTERNAL_BUFFER_SIZE-to-fix-running-out-of-bu.patch similarity index 73% rename from Patches/0004-Double-INTERNAL_BUFFER_SIZE-to-fix-running-out-of-bu.patch rename to Patches/0001-Double-INTERNAL_BUFFER_SIZE-to-fix-running-out-of-bu.patch index 65309ed..9920049 100644 --- a/Patches/0004-Double-INTERNAL_BUFFER_SIZE-to-fix-running-out-of-bu.patch +++ b/Patches/0001-Double-INTERNAL_BUFFER_SIZE-to-fix-running-out-of-bu.patch @@ -1,17 +1,17 @@ -From 400dd05b52729ab35449444393a690141d1d5cfb Mon Sep 17 00:00:00 2001 +From f222e497b412718008021b01b7b0ad0069348b88 Mon Sep 17 00:00:00 2001 From: Alexander Strange Date: Tue, 13 Jul 2010 16:07:20 -0700 -Subject: [PATCH 4/6] Double INTERNAL_BUFFER_SIZE to fix running out of +Subject: [PATCH 1/2] Double INTERNAL_BUFFER_SIZE to fix running out of buffers when QT retains 32 of them Fixes a crash in some mp4. --- - libavcodec/mpegvideo.h | 2 +- - libavcodec/utils.c | 2 +- + libavcodec/mpegvideo.h | 2 +- + libavcodec/utils.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h -index 46ad5d8..7d68aa7 100644 +index 06be735..5675265 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -57,7 +57,7 @@ enum OutputFormat { @@ -24,10 +24,10 @@ index 46ad5d8..7d68aa7 100644 #define ME_MAP_SIZE 64 #define ME_MAP_SHIFT 3 diff --git a/libavcodec/utils.c b/libavcodec/utils.c -index 04909cf..8da3fcb 100644 +index f64bff8..166b6de 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c -@@ -125,7 +125,7 @@ void avcodec_set_dimensions(AVCodecContext *s, int width, int height){ +@@ -137,7 +137,7 @@ void avcodec_set_dimensions(AVCodecContext *s, int width, int height){ s->height= -((-height)>>s->lowres); } @@ -37,5 +37,5 @@ index 04909cf..8da3fcb 100644 void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int linesize_align[AV_NUM_DATA_POINTERS]) -- -1.7.8 +1.8.0 diff --git a/Patches/0002-Remove-the-warning-Cannot-parallelize-deblocking-typ.patch b/Patches/0002-Remove-the-warning-Cannot-parallelize-deblocking-typ.patch deleted file mode 100644 index 9fe2065..0000000 --- a/Patches/0002-Remove-the-warning-Cannot-parallelize-deblocking-typ.patch +++ /dev/null @@ -1,29 +0,0 @@ -From d917df594b2585dbb86fe273eb3e59f18e3567b9 Mon Sep 17 00:00:00 2001 -From: Alexander Strange -Date: Sun, 22 Nov 2009 04:09:09 -0500 -Subject: [PATCH 2/6] Remove the warning "Cannot parallelize deblocking type - 1". - ---- - libavcodec/h264.c | 5 +---- - 1 files changed, 1 insertions(+), 4 deletions(-) - -diff --git a/libavcodec/h264.c b/libavcodec/h264.c -index acd7179..7d27caa 100644 ---- a/libavcodec/h264.c -+++ b/libavcodec/h264.c -@@ -3144,10 +3144,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ - h->deblocking_filter = 2; - } else { - h0->max_contexts = 1; -- if(!h0->single_decode_warning) { -- av_log(s->avctx, AV_LOG_INFO, "Cannot parallelize deblocking type 1, decoding such frames in sequential order\n"); -- h0->single_decode_warning = 1; -- } -+ - if (h != h0) { - av_log(h->s.avctx, AV_LOG_ERROR, "Deblocking switched inside frame.\n"); - return 1; --- -1.7.8 - diff --git a/Patches/0005-Workaround-for-AVI-audio-tracks-importing-1152x-too-.patch b/Patches/0002-Workaround-for-AVI-audio-tracks-importing-1152x-too-.patch similarity index 69% rename from Patches/0005-Workaround-for-AVI-audio-tracks-importing-1152x-too-.patch rename to Patches/0002-Workaround-for-AVI-audio-tracks-importing-1152x-too-.patch index 97111b4..f2cd285 100644 --- a/Patches/0005-Workaround-for-AVI-audio-tracks-importing-1152x-too-.patch +++ b/Patches/0002-Workaround-for-AVI-audio-tracks-importing-1152x-too-.patch @@ -1,14 +1,14 @@ -From 05d311486ffbd12d3afa9af6d1b4eeff98deffaa Mon Sep 17 00:00:00 2001 +From 7580892bd9cfe66ad4058eac564e4342ef408ea0 Mon Sep 17 00:00:00 2001 From: Alexander Strange Date: Sat, 6 Nov 2010 05:24:09 -0400 -Subject: [PATCH 5/6] Workaround for AVI audio tracks importing 1152x too long +Subject: [PATCH 2/2] Workaround for AVI audio tracks importing 1152x too long --- - libavformat/avidec.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) + libavformat/avidec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/avidec.c b/libavformat/avidec.c -index ad35995..8ab97b0 100644 +index af6ee8e..7f170e3 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -98,7 +98,7 @@ static int guess_ni_flag(AVFormatContext *s); @@ -21,5 +21,5 @@ index ad35995..8ab97b0 100644 return (len + ast->dshow_block_align - 1)/ast->dshow_block_align; }else -- -1.7.8 +1.8.0 diff --git a/Patches/0003-Hardcode-results-of-runtime-cpu-detection-in-dsputil.patch b/Patches/0003-Hardcode-results-of-runtime-cpu-detection-in-dsputil.patch deleted file mode 100644 index 96a7eca..0000000 --- a/Patches/0003-Hardcode-results-of-runtime-cpu-detection-in-dsputil.patch +++ /dev/null @@ -1,53 +0,0 @@ -From afc905bbe111ea1da1ca80c129a5ddd1d9f5610d Mon Sep 17 00:00:00 2001 -From: Alexander Strange -Date: Sun, 22 Nov 2009 16:33:58 -0500 -Subject: [PATCH 3/6] Hardcode results of runtime cpu-detection in dsputil for - SSE2/3DNOW. - -This isn't the same as fixing --disable-runtimecpudetection in mainline, -since we still need to run it to detect features newer than SSE2. - -There are still unused mmx2 and c DSP functions in the binary, -presumably due to missed optimizations. - -Results in ~400KB smaller Perian binary. - -TODO: -- fix --disable-3dnow to actually disable this in mainline. ---- - libavcodec/x86/dsputil_mmx.c | 19 +++++++++++++++++++ - 1 files changed, 19 insertions(+), 0 deletions(-) - -diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c -index 104bd75..3578665 100644 ---- a/libavcodec/x86/dsputil_mmx.c -+++ b/libavcodec/x86/dsputil_mmx.c -@@ -2429,6 +2429,25 @@ extern void ff_butterflies_float_interleave_sse(float *dst, const float *src0, - extern void ff_butterflies_float_interleave_avx(float *dst, const float *src0, - const float *src1, int len); - -+#undef FF_MM_MMX -+#undef FF_MM_MMX2 -+#undef FF_MM_3DNOW -+#undef FF_MM_3DNOWEXT -+#undef FF_MM_SSE -+#undef FF_MM_SSE2 -+#undef CODEC_FLAG_BITEXACT -+ -+#define ON 0 || 1 -+#define OFF 0 -+ -+#define FF_MM_MMX ON -+#define FF_MM_MMX2 ON -+#define FF_MM_3DNOW OFF -+#define FF_MM_3DNOWEXT OFF -+#define FF_MM_SSE ON -+#define FF_MM_SSE2 ON -+#define CODEC_FLAG_BITEXACT 0 -+ - void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) - { - int mm_flags = av_get_cpu_flags(); --- -1.7.8 - diff --git a/Patches/0006-Workaround-hang-issue-in-configure.patch b/Patches/0006-Workaround-hang-issue-in-configure.patch deleted file mode 100644 index b50573e..0000000 --- a/Patches/0006-Workaround-hang-issue-in-configure.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 8f5e873c4e3c677876eacc6649740c2a8b971b0f Mon Sep 17 00:00:00 2001 -From: Alexander Strange -Date: Sat, 10 Dec 2011 02:40:36 -0500 -Subject: [PATCH 6/6] Workaround hang issue in configure - ---- - configure | 12 +----------- - 1 files changed, 1 insertions(+), 11 deletions(-) - -diff --git a/configure b/configure -index a0dc6e0..42bd02f 100755 ---- a/configure -+++ b/configure -@@ -2718,17 +2718,7 @@ elif enabled x86; then - - enable local_aligned_8 local_aligned_16 - -- # check whether EBP is available on x86 -- # As 'i' is stored on the stack, this program will crash -- # if the base pointer is used to access it because the -- # base pointer is cleared in the inline assembly code. -- check_exec_crash <