summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2016-04-04 22:52:51 -0400
committerMark H Weaver <mhw@netris.org>2016-04-04 22:55:52 -0400
commitfd7fd3c1678a63eb22995fef1d1eed09ff57efe6 (patch)
tree19f52d433fe48ff3bc1e30d8b9073915f353772d /gnu
parentae05e366bea4517f1e428799f00f11997ccef661 (diff)
gnu: libextractor: Add patch to fix build with ffmpeg-3.
* gnu/packages/patches/libextractor-ffmpeg-3.patch: New file. * gnu-system.am (dist_patch_DATA): Add it. * gnu/packages/gnunet.scm (libextractor)[source]: Add patch.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/gnunet.scm2
-rw-r--r--gnu/packages/patches/libextractor-ffmpeg-3.patch147
2 files changed, 149 insertions, 0 deletions
diff --git a/gnu/packages/gnunet.scm b/gnu/packages/gnunet.scm
index eb0c4cbe836..471f383b85b 100644
--- a/gnu/packages/gnunet.scm
+++ b/gnu/packages/gnunet.scm
@@ -5,6 +5,7 @@
5;;; Copyright © 2015 Efraim Flashner <efraim@flashner.co.il> 5;;; Copyright © 2015 Efraim Flashner <efraim@flashner.co.il>
6;;; Copyright © 2016 Ni* Gillmann <ng@niasterisk.space> 6;;; Copyright © 2016 Ni* Gillmann <ng@niasterisk.space>
7;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net> 7;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
8;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
8;;; 9;;;
9;;; This file is part of GNU Guix. 10;;; This file is part of GNU Guix.
10;;; 11;;;
@@ -66,6 +67,7 @@
66 (sha256 67 (sha256
67 (base32 68 (base32
68 "0zvv7wd011npcx7yphw9bpgivyxz6mlp87a57n96nv85k96dd2l6")) 69 "0zvv7wd011npcx7yphw9bpgivyxz6mlp87a57n96nv85k96dd2l6"))
70 (patches (list (search-patch "libextractor-ffmpeg-3.patch")))
69 (modules '((guix build utils))) 71 (modules '((guix build utils)))
70 (snippet 72 (snippet
71 ;; Nowadays libmagic (from 'file') returns 'audio/ogg' and not 73 ;; Nowadays libmagic (from 'file') returns 'audio/ogg' and not
diff --git a/gnu/packages/patches/libextractor-ffmpeg-3.patch b/gnu/packages/patches/libextractor-ffmpeg-3.patch
new file mode 100644
index 00000000000..7688bdc37fd
--- /dev/null
+++ b/gnu/packages/patches/libextractor-ffmpeg-3.patch
@@ -0,0 +1,147 @@
1Fix build for ffmpeg-3.0.
2Based on a patch by Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
3for ffmpeg-2.9, found at <https://gnunet.org/bugs/view.php?id=4167>
4and later modified by Mark H Weaver <mhw@netris.org> for ffmpeg-3.0.
5
6--- libextractor-1.3/src/plugins/thumbnailffmpeg_extractor.c.orig 2013-12-21 11:04:41.000000000 -0500
7+++ libextractor-1.3/src/plugins/thumbnailffmpeg_extractor.c 2016-04-04 22:42:17.859001669 -0400
8@@ -153,7 +153,7 @@
9 static size_t
10 create_thumbnail (int src_width, int src_height,
11 int src_stride[],
12- enum PixelFormat src_pixfmt,
13+ enum AVPixelFormat src_pixfmt,
14 const uint8_t * const src_data[],
15 int dst_width, int dst_height,
16 uint8_t **output_data,
17@@ -189,7 +189,7 @@
18 if (NULL ==
19 (scaler_ctx =
20 sws_getContext (src_width, src_height, src_pixfmt,
21- dst_width, dst_height, PIX_FMT_RGB24,
22+ dst_width, dst_height, AV_PIX_FMT_RGB24,
23 SWS_BILINEAR, NULL, NULL, NULL)))
24 {
25 #if DEBUG
26@@ -199,7 +199,7 @@
27 return 0;
28 }
29
30- if (NULL == (dst_frame = avcodec_alloc_frame ()))
31+ if (NULL == (dst_frame = av_frame_alloc ()))
32 {
33 #if DEBUG
34 fprintf (stderr,
35@@ -209,7 +209,7 @@
36 return 0;
37 }
38 if (NULL == (dst_buffer =
39- av_malloc (avpicture_get_size (PIX_FMT_RGB24, dst_width, dst_height))))
40+ av_malloc (avpicture_get_size (AV_PIX_FMT_RGB24, dst_width, dst_height))))
41 {
42 #if DEBUG
43 fprintf (stderr,
44@@ -220,7 +220,7 @@
45 return 0;
46 }
47 avpicture_fill ((AVPicture *) dst_frame, dst_buffer,
48- PIX_FMT_RGB24, dst_width, dst_height);
49+ AV_PIX_FMT_RGB24, dst_width, dst_height);
50 sws_scale (scaler_ctx,
51 src_data,
52 src_stride,
53@@ -255,7 +255,7 @@
54 }
55 encoder_codec_ctx->width = dst_width;
56 encoder_codec_ctx->height = dst_height;
57- encoder_codec_ctx->pix_fmt = PIX_FMT_RGB24;
58+ encoder_codec_ctx->pix_fmt = AV_PIX_FMT_RGB24;
59 opts = NULL;
60 if (avcodec_open2 (encoder_codec_ctx, encoder_codec, &opts) < 0)
61 {
62@@ -410,7 +410,7 @@
63 return;
64 }
65 av_dict_free (&opts);
66- if (NULL == (frame = avcodec_alloc_frame ()))
67+ if (NULL == (frame = av_frame_alloc ()))
68 {
69 #if DEBUG
70 fprintf (stderr,
71@@ -563,7 +563,7 @@
72 return;
73 }
74
75- if (NULL == (frame = avcodec_alloc_frame ()))
76+ if (NULL == (frame = av_frame_alloc ()))
77 {
78 #if DEBUG
79 fprintf (stderr,
80--- libextractor-1.3/src/plugins/previewopus_extractor.c.orig 2013-12-22 17:44:18.000000000 -0500
81+++ libextractor-1.3/src/plugins/previewopus_extractor.c 2016-04-04 22:49:05.168105265 -0400
82@@ -296,7 +296,7 @@
83 /** Initialize one audio frame for reading from the input file */
84 static int init_input_frame(AVFrame **frame)
85 {
86- if (!(*frame = avcodec_alloc_frame())) {
87+ if (!(*frame = av_frame_alloc())) {
88 #if DEBUG
89 fprintf(stderr, "Could not allocate input frame\n");
90 #endif
91@@ -655,7 +655,7 @@
92 av_freep(&converted_input_samples[0]);
93 free(converted_input_samples);
94 }
95- avcodec_free_frame(&input_frame);
96+ av_frame_free(&input_frame);
97
98 return ret;
99 }
100@@ -671,7 +671,7 @@
101 int error;
102
103 /** Create a new frame to store the audio samples. */
104- if (!(*frame = avcodec_alloc_frame())) {
105+ if (!(*frame = av_frame_alloc())) {
106 #if DEBUG
107 fprintf(stderr, "Could not allocate output frame\n");
108 #endif
109@@ -702,7 +702,7 @@
110 #if DEBUG
111 fprintf(stderr, "Could allocate output frame samples (error '%s')\n", get_error_text(error));
112 #endif
113- avcodec_free_frame(frame);
114+ av_frame_free(frame);
115 return error;
116 }
117
118@@ -783,17 +783,17 @@
119 #if DEBUG
120 fprintf(stderr, "Could not read data from FIFO\n");
121 #endif
122- avcodec_free_frame(&output_frame);
123+ av_frame_free(&output_frame);
124 return AVERROR_EXIT;
125 }
126
127 /** Encode one frame worth of audio samples. */
128 if (encode_audio_frame(output_frame, output_format_context,
129 output_codec_context, &data_written)) {
130- avcodec_free_frame(&output_frame);
131+ av_frame_free(&output_frame);
132 return AVERROR_EXIT;
133 }
134- avcodec_free_frame(&output_frame);
135+ av_frame_free(&output_frame);
136 return 0;
137 }
138 /** Write the trailer of the output file container. */
139@@ -907,7 +907,7 @@
140 return;
141 }
142
143- if (NULL == (frame = avcodec_alloc_frame ()))
144+ if (NULL == (frame = av_frame_alloc ()))
145 {
146 #if DEBUG
147 fprintf (stderr,