~ubuntu-branches/ubuntu/lucid/chromium-codecs-ffmpeg/lucid-proposed

« back to all changes in this revision

Viewing changes to patches/to_upstream/01_static_pthread_O2.patch

  • Committer: Bazaar Package Importer
  • Author(s): Fabien Tassin
  • Date: 2010-08-15 04:00:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100815040002-jqykij4evopfsj4s
Tags: 0.6+svn20100811r55740+56137-0ubuntu0.10.04.1
* New upstream snapshot (LP: #628924)
* Drop the sse2 patch, it has been applied upstream, and set disable_sse2
  - drop debian/patches/*
  - update debian/rules
* Unpack the sources during pre-build so quilt has access to all source files
  and set QUILT_PATCHES (for hardy)
  - update debian/rules
* Add libvpx-dev to Build-Depends and set the use_system_vpx gyp knob
  - update debian/control
  - update debian/rules
* Re-do the get-orig-source rule with 2 repos instead of 3 following
  the upstream reorganization and follow the revision requested by
  Chromium for now on
  - update debian/rules
* FTBFS when an upstream patch fails to apply, as it could lead to weird
  situations
  - update debian/rules
* Bump build-deps for gyp to >= 0.1~svn837
  - update debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
diff -rpu -N unpatched-ffmpeg-mt/configure patched-ffmpeg-mt/configure
2
 
--- unpatched-ffmpeg-mt/configure       2010-03-29 16:40:27 -0700
3
 
+++ patched-ffmpeg-mt/configure 2010-03-31 19:01:13 -0700
4
 
@@ -1711,7 +1711,7 @@ if   $cc -v 2>&1 | grep -qi ^gcc; then
5
 
         CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
6
 
         AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
7
 
     fi
8
 
-    speed_cflags='-O3'
9
 
+    speed_cflags='-O2'
10
 
     size_cflags='-Os'
11
 
 elif $cc --version 2>/dev/null | grep -q Intel; then
12
 
     cc_type=icc
13
 
@@ -2555,6 +2555,9 @@ if enabled pthreads; then
14
 
         add_extralibs -pthreads
15
 
     elif check_func pthread_create -lpthreadGC2; then
16
 
         add_extralibs -lpthreadGC2
17
 
+    elif check_func pthread_create -lpthreadGC2 -lws2_32; then
18
 
+        add_cflags -DPTW32_STATIC_LIB
19
 
+        add_extralibs -lpthreadGC2 -lws2_32
20
 
     elif ! check_lib pthread.h pthread_create -lpthread; then
21
 
         die "ERROR: can't find pthreads library"
22
 
     fi
23
 
@@ -2752,7 +2755,7 @@ elif enabled ccc; then
24
 
 elif enabled gcc; then
25
 
     check_cflags -fno-tree-vectorize
26
 
     check_cflags -Werror=implicit
27
 
-    check_cflags -Werror=missing-prototypes
28
 
+#    check_cflags -Werror=missing-prototypes
29
 
 elif enabled clang; then
30
 
     check_cflags -Qunused-arguments
31
 
 elif enabled armcc; then
32
 
diff -rpu -N unpatched-ffmpeg-mt/libavcodec/allcodecs.c patched-ffmpeg-mt/libavcodec/allcodecs.c
33
 
--- unpatched-ffmpeg-mt/libavcodec/allcodecs.c  2010-03-29 14:43:02 -0700
34
 
+++ patched-ffmpeg-mt/libavcodec/allcodecs.c    2010-03-31 19:01:13 -0700
35
 
@@ -45,6 +45,14 @@
36
 
           extern AVBitStreamFilter x##_bsf; \
37
 
           if(CONFIG_##X##_BSF)     av_register_bitstream_filter(&x##_bsf); }
38
 
 
39
 
+#ifdef PTW32_STATIC_LIB
40
 
+static void detach_ptw32(void)
41
 
+{
42
 
+    pthread_win32_thread_detach_np();
43
 
+    pthread_win32_process_detach_np();
44
 
+}
45
 
+#endif
46
 
+
47
 
 void avcodec_register_all(void)
48
 
 {
49
 
     static int initialized;
50
 
@@ -53,6 +61,11 @@ void avcodec_register_all(void)
51
 
         return;
52
 
     initialized = 1;
53
 
 
54
 
+#ifdef PTW32_STATIC_LIB
55
 
+    pthread_win32_process_attach_np();
56
 
+    pthread_win32_thread_attach_np();
57
 
+    atexit(detach_ptw32);
58
 
+#endif
59
 
     /* hardware accelerators */
60
 
     REGISTER_HWACCEL (H263_VAAPI, h263_vaapi);
61
 
     REGISTER_HWACCEL (H264_DXVA2, h264_dxva2);
 
1
diff -rpu -N orig/configure ffmpeg-mt/configure
 
2
--- orig/configure      2010-07-27 13:05:17.865562700 -0700
 
3
+++ ffmpeg-mt/configure 2010-07-27 13:05:29.670743100 -0700
 
4
@@ -1788,7 +1788,7 @@ if   $cc -v 2>&1 | grep -qi ^gcc; then
 
5
         CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
 
6
         AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
 
7
     fi
 
8
-    speed_cflags='-O3'
 
9
+    speed_cflags='-O2'
 
10
     size_cflags='-Os'
 
11
 elif $cc --version 2>/dev/null | grep -q Intel; then
 
12
     cc_type=icc
 
13
@@ -2607,6 +2607,9 @@ if ! disabled pthreads && ! enabled w32t
 
14
         add_extralibs -pthreads
 
15
     elif check_func pthread_create -lpthreadGC2; then
 
16
         add_extralibs -lpthreadGC2
 
17
+    elif check_func pthread_create -lpthreadGC2 -lws2_32; then
 
18
+        add_cflags -DPTW32_STATIC_LIB
 
19
+        add_extralibs -lpthreadGC2 -lws2_32
 
20
     elif ! check_lib pthread.h pthread_create -lpthread; then
 
21
         disable pthreads
 
22
     fi
 
23
@@ -2823,7 +2826,6 @@ elif enabled ccc; then
 
24
 elif enabled gcc; then
 
25
     check_cflags -fno-tree-vectorize
 
26
     check_cflags -Werror=implicit-function-declaration
 
27
-    check_cflags -Werror=missing-prototypes
 
28
 elif enabled clang; then
 
29
     check_cflags -Qunused-arguments
 
30
 elif enabled armcc; then
 
31
diff -rpu -N orig/libavcodec/allcodecs.c ffmpeg-mt/libavcodec/allcodecs.c
 
32
--- orig/libavcodec/allcodecs.c 2010-07-27 13:05:18.281604300 -0700
 
33
+++ ffmpeg-mt/libavcodec/allcodecs.c    2010-07-27 13:05:29.675743600 -0700
 
34
@@ -45,6 +45,14 @@
 
35
           extern AVBitStreamFilter x##_bsf; \
 
36
           if(CONFIG_##X##_BSF)     av_register_bitstream_filter(&x##_bsf); }
 
37
 
 
38
+#ifdef PTW32_STATIC_LIB
 
39
+static void detach_ptw32(void)
 
40
+{
 
41
+    pthread_win32_thread_detach_np();
 
42
+    pthread_win32_process_detach_np();
 
43
+}
 
44
+#endif
 
45
+
 
46
 void avcodec_register_all(void)
 
47
 {
 
48
     static int initialized;
 
49
@@ -53,6 +61,11 @@ void avcodec_register_all(void)
 
50
         return;
 
51
     initialized = 1;
 
52
 
 
53
+#ifdef PTW32_STATIC_LIB
 
54
+    pthread_win32_process_attach_np();
 
55
+    pthread_win32_thread_attach_np();
 
56
+    atexit(detach_ptw32);
 
57
+#endif
 
58
     /* hardware accelerators */
 
59
     REGISTER_HWACCEL (H263_VAAPI, h263_vaapi);
 
60
     REGISTER_HWACCEL (H264_DXVA2, h264_dxva2);