Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-sound/xmms2/files/
Date: Fri, 06 Jul 2018 20:45:18
Message-Id: 1530909896.48f201e4132579d760bac89bb02085d864489a38.slyfox@gentoo
1 commit: 48f201e4132579d760bac89bb02085d864489a38
2 Author: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail <DOT> com>
3 AuthorDate: Wed Jul 4 16:28:24 2018 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 6 20:44:56 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48f201e4
7
8 media-sound/xmms2: remove unused patches
9
10 Closes: https://github.com/gentoo/gentoo/pull/9048
11
12 media-sound/xmms2/files/xmms2-0.8-audio4-p1.patch | 123 -------
13 media-sound/xmms2/files/xmms2-0.8-audio4-p2.patch | 171 ---------
14 media-sound/xmms2/files/xmms2-0.8-audio4-p3.patch | 388 ---------------------
15 media-sound/xmms2/files/xmms2-0.8-audio4-p4.patch | 296 ----------------
16 media-sound/xmms2/files/xmms2-0.8-audio4-p5.patch | 154 --------
17 media-sound/xmms2/files/xmms2-0.8-audio4-p6.patch | 106 ------
18 media-sound/xmms2/files/xmms2-0.8-audio4-p7.patch | 147 --------
19 media-sound/xmms2/files/xmms2-0.8-cpython.patch | 9 -
20 .../xmms2/files/xmms2-0.8-cython-0.19.1.patch | 47 ---
21 .../xmms2/files/xmms2-0.8-ffmpeg-0.11.patch | 18 -
22 media-sound/xmms2/files/xmms2-0.8-libav-9-p2.patch | 50 ---
23 media-sound/xmms2/files/xmms2-0.8-libav-9.patch | 20 --
24 media-sound/xmms2/files/xmms2-0.8-memset.patch | 19 -
25 media-sound/xmms2/files/xmms2-0.8-modpug.patch | 11 -
26 media-sound/xmms2/files/xmms2-0.8-samba-4.patch | 30 --
27 15 files changed, 1589 deletions(-)
28
29 diff --git a/media-sound/xmms2/files/xmms2-0.8-audio4-p1.patch b/media-sound/xmms2/files/xmms2-0.8-audio4-p1.patch
30 deleted file mode 100644
31 index 21ed6492a44..00000000000
32 --- a/media-sound/xmms2/files/xmms2-0.8-audio4-p1.patch
33 +++ /dev/null
34 @@ -1,123 +0,0 @@
35 -commit 8831bc77d705c03b3f8081de0520dd10afa85c69
36 -Author: Uli Franke <cls@×××××××.org>
37 -Date: Tue Jan 17 23:23:46 2012 +0100
38 -
39 - BUG(2509): Avoid unaligned reads in avcodec xform.
40 -
41 -diff --git a/src/plugins/avcodec/avcodec.c b/src/plugins/avcodec/avcodec.c
42 -index fe58fc5..1b4a659 100644
43 ---- a/src/plugins/avcodec/avcodec.c
44 -+++ b/src/plugins/avcodec/avcodec.c
45 -@@ -36,6 +36,9 @@ typedef struct {
46 - guint buffer_size;
47 - gboolean no_demuxer;
48 -
49 -+ gchar *read_out_buffer;
50 -+ gint read_out_buffer_size;
51 -+
52 - guint channels;
53 - guint samplerate;
54 - xmms_sample_format_t sampleformat;
55 -@@ -107,6 +110,7 @@ xmms_avcodec_destroy (xmms_xform_t *xform)
56 -
57 - avcodec_close (data->codecctx);
58 - av_free (data->codecctx);
59 -+ av_free (data->read_out_buffer);
60 -
61 - g_string_free (data->outbuf, TRUE);
62 - g_free (data->buffer);
63 -@@ -132,6 +136,9 @@ xmms_avcodec_init (xmms_xform_t *xform)
64 - data->buffer_size = AVCODEC_BUFFER_SIZE;
65 - data->codecctx = NULL;
66 -
67 -+ data->read_out_buffer = av_malloc (AVCODEC_MAX_AUDIO_FRAME_SIZE);
68 -+ data->read_out_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
69 -+
70 - xmms_xform_private_data_set (xform, data);
71 -
72 - avcodec_init ();
73 -@@ -196,7 +203,7 @@ xmms_avcodec_init (xmms_xform_t *xform)
74 - } else {
75 - /* A demuxer plugin forgot to give decoder config? */
76 - xmms_log_error ("Decoder config data not found!");
77 -- return FALSE;
78 -+ goto err;
79 - }
80 - }
81 -
82 -@@ -220,7 +227,7 @@ xmms_avcodec_init (xmms_xform_t *xform)
83 -
84 - /* some codecs need to have something read before they set
85 - * the samplerate and channels correctly, unfortunately... */
86 -- if ((ret = xmms_avcodec_read (xform, buf, 42, &error)) > 0) {
87 -+ if ((ret = xmms_avcodec_read (xform, buf, sizeof (buf), &error)) > 0) {
88 - g_string_insert_len (data->outbuf, 0, buf, ret);
89 - } else {
90 - XMMS_DBG ("First read failed, codec is not working...");
91 -@@ -251,6 +258,9 @@ err:
92 - if (data->codecctx) {
93 - av_free (data->codecctx);
94 - }
95 -+ if (data->read_out_buffer) {
96 -+ av_free (data->read_out_buffer);
97 -+ }
98 - g_string_free (data->outbuf, TRUE);
99 - g_free (data->extradata);
100 - g_free (data);
101 -@@ -263,8 +273,7 @@ xmms_avcodec_read (xmms_xform_t *xform, xmms_sample_t *buf, gint len,
102 - xmms_error_t *error)
103 - {
104 - xmms_avcodec_data_t *data;
105 -- char outbuf[AVCODEC_MAX_AUDIO_FRAME_SIZE];
106 -- gint outbufsize, bytes_read = 0;
107 -+ gint bytes_read = 0;
108 - guint size;
109 -
110 - data = xmms_xform_private_data_get (xform);
111 -@@ -330,9 +339,9 @@ xmms_avcodec_read (xmms_xform_t *xform, xmms_sample_t *buf, gint len,
112 - packet.data = data->buffer;
113 - packet.size = data->buffer_length;
114 -
115 -- outbufsize = sizeof (outbuf);
116 -- bytes_read = avcodec_decode_audio3 (data->codecctx, (short *) outbuf,
117 -- &outbufsize, &packet);
118 -+ data->read_out_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
119 -+ bytes_read = avcodec_decode_audio3 (data->codecctx, (short *) data->read_out_buffer,
120 -+ &data->read_out_buffer_size, &packet);
121 -
122 - /* The DTS decoder of ffmpeg is buggy and always returns
123 - * the input buffer length, get frame length from header */
124 -@@ -354,8 +363,8 @@ xmms_avcodec_read (xmms_xform_t *xform, xmms_sample_t *buf, gint len,
125 -
126 - data->buffer_length -= bytes_read;
127 -
128 -- if (outbufsize > 0) {
129 -- g_string_append_len (data->outbuf, outbuf, outbufsize);
130 -+ if (data->read_out_buffer_size > 0) {
131 -+ g_string_append_len (data->outbuf, data->read_out_buffer, data->read_out_buffer_size);
132 - }
133 -
134 - size = MIN (data->outbuf->len, len);
135 -@@ -371,8 +380,7 @@ static gint64
136 - xmms_avcodec_seek (xmms_xform_t *xform, gint64 samples, xmms_xform_seek_mode_t whence, xmms_error_t *err)
137 - {
138 - xmms_avcodec_data_t *data;
139 -- char outbuf[AVCODEC_MAX_AUDIO_FRAME_SIZE];
140 -- gint outbufsize, bytes_read = 0;
141 -+ gint bytes_read = 0;
142 - gint64 ret = -1;
143 -
144 - g_return_val_if_fail (xform, -1);
145 -@@ -396,9 +404,9 @@ xmms_avcodec_seek (xmms_xform_t *xform, gint64 samples, xmms_xform_seek_mode_t w
146 - packet.data = data->buffer;
147 - packet.size = data->buffer_length;
148 -
149 -- outbufsize = sizeof (outbuf);
150 -- bytes_read = avcodec_decode_audio3 (data->codecctx, (short *) outbuf,
151 -- &outbufsize, &packet);
152 -+ data->read_out_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
153 -+ bytes_read = avcodec_decode_audio3 (data->codecctx, (short *) data->read_out_buffer,
154 -+ &data->read_out_buffer_size, &packet);
155 -
156 - if (bytes_read < 0 || bytes_read > data->buffer_length) {
157 - XMMS_DBG ("Error decoding data!");
158
159 diff --git a/media-sound/xmms2/files/xmms2-0.8-audio4-p2.patch b/media-sound/xmms2/files/xmms2-0.8-audio4-p2.patch
160 deleted file mode 100644
161 index 70334587d42..00000000000
162 --- a/media-sound/xmms2/files/xmms2-0.8-audio4-p2.patch
163 +++ /dev/null
164 @@ -1,171 +0,0 @@
165 -commit b614459dc1ea353d6c24b4a77c7f92a5577d5bc3
166 -Author: Uli Franke <cls@×××××××.org>
167 -Date: Thu Jan 19 11:53:57 2012 +0100
168 -
169 - BUG(2510): Add more bitrates/samplerates to AAC/ALAC.
170 -
171 -diff --git a/src/plugins/avcodec/avcodec.c b/src/plugins/avcodec/avcodec.c
172 -index 1b4a659..b32de4d 100644
173 ---- a/src/plugins/avcodec/avcodec.c
174 -+++ b/src/plugins/avcodec/avcodec.c
175 -@@ -60,6 +60,7 @@ static gint xmms_avcodec_read (xmms_xform_t *xform, xmms_sample_t *buf, gint len
176 - xmms_error_t *error);
177 - static gint64 xmms_avcodec_seek (xmms_xform_t *xform, gint64 samples,
178 - xmms_xform_seek_mode_t whence, xmms_error_t *err);
179 -+static xmms_sample_format_t xmms_avcodec_translate_sample_format (enum AVSampleFormat av_sample_format);
180 -
181 - /*
182 - * Plugin header
183 -@@ -168,12 +169,12 @@ xmms_avcodec_init (xmms_xform_t *xform)
184 - data->channels = ret;
185 - }
186 -
187 -- /* bitrate required for WMA files */
188 -+ /* Required by WMA xform. */
189 - xmms_xform_auxdata_get_int (xform,
190 - "bitrate",
191 - &data->bitrate);
192 -
193 -- /* ALAC and MAC require bits per sample field to be 16 */
194 -+ /* Required by tta and apefile xforms. */
195 - xmms_xform_auxdata_get_int (xform,
196 - "samplebits",
197 - &data->samplebits);
198 -@@ -238,12 +239,17 @@ xmms_avcodec_init (xmms_xform_t *xform)
199 -
200 - data->samplerate = data->codecctx->sample_rate;
201 - data->channels = data->codecctx->channels;
202 -+ data->sampleformat = xmms_avcodec_translate_sample_format (data->codecctx->sample_fmt);
203 -+ if (data->sampleformat == XMMS_SAMPLE_FORMAT_UNKNOWN) {
204 -+ avcodec_close (data->codecctx);
205 -+ goto err;
206 -+ }
207 -
208 - xmms_xform_outdata_type_add (xform,
209 - XMMS_STREAM_TYPE_MIMETYPE,
210 - "audio/pcm",
211 - XMMS_STREAM_TYPE_FMT_FORMAT,
212 -- XMMS_SAMPLE_FORMAT_S16,
213 -+ data->sampleformat,
214 - XMMS_STREAM_TYPE_FMT_CHANNELS,
215 - data->channels,
216 - XMMS_STREAM_TYPE_FMT_SAMPLERATE,
217 -@@ -428,3 +434,23 @@ xmms_avcodec_seek (xmms_xform_t *xform, gint64 samples, xmms_xform_seek_mode_t w
218 -
219 - return ret;
220 - }
221 -+
222 -+static xmms_sample_format_t
223 -+xmms_avcodec_translate_sample_format (enum AVSampleFormat av_sample_format)
224 -+{
225 -+ switch (av_sample_format) {
226 -+ case AV_SAMPLE_FMT_U8:
227 -+ return XMMS_SAMPLE_FORMAT_U8;
228 -+ case AV_SAMPLE_FMT_S16:
229 -+ return XMMS_SAMPLE_FORMAT_S16;
230 -+ case AV_SAMPLE_FMT_S32:
231 -+ return XMMS_SAMPLE_FORMAT_S32;
232 -+ case AV_SAMPLE_FMT_FLT:
233 -+ return XMMS_SAMPLE_FORMAT_FLOAT;
234 -+ case AV_SAMPLE_FMT_DBL:
235 -+ return XMMS_SAMPLE_FORMAT_DOUBLE;
236 -+ default:
237 -+ XMMS_DBG ("AVSampleFormat (%i) not supported.", av_sample_format);
238 -+ return XMMS_SAMPLE_FORMAT_UNKNOWN;
239 -+ }
240 -+}
241 -diff --git a/src/plugins/mp4/mp4.c b/src/plugins/mp4/mp4.c
242 -index 7c915c4..3ee9357 100644
243 ---- a/src/plugins/mp4/mp4.c
244 -+++ b/src/plugins/mp4/mp4.c
245 -@@ -186,9 +186,6 @@ xmms_mp4_init (xmms_xform_t *xform)
246 - xmms_xform_auxdata_set_bin (xform, "decoder_config", tmpbuf, tmpbuflen);
247 - g_free (tmpbuf);
248 -
249 -- /* This is only for ALAC to set 16-bit samples, ignored for AAC */
250 -- xmms_xform_auxdata_set_int (xform, "samplebits", 16);
251 --
252 - xmms_mp4_get_mediainfo (xform);
253 -
254 - XMMS_DBG ("MP4 demuxer inited successfully!");
255 -@@ -288,7 +285,7 @@ xmms_mp4_get_mediainfo (xmms_xform_t *xform)
256 - data = xmms_xform_private_data_get (xform);
257 - g_return_if_fail (data);
258 -
259 -- if ((temp = mp4ff_get_sample_rate (data->mp4ff, data->track)) >= 0) {
260 -+ if ((temp = mp4ff_get_sample_rate (data->mp4ff, data->track)) > 0) {
261 - glong srate = temp;
262 -
263 - if ((temp = mp4ff_get_track_duration_use_offsets (data->mp4ff,
264 -@@ -492,7 +489,7 @@ xmms_mp4_get_track (xmms_xform_t *xform, mp4ff_t *infile)
265 - case 0x69: /* MPEG-2 audio */
266 - case 0x6B: /* MPEG-1 audio */
267 - continue;
268 -- case 0xff:
269 -+ case 0xff: /* ALAC */
270 - chans = mp4ff_get_channel_count (infile, i);
271 - rate = mp4ff_get_sample_rate (infile, i);
272 - if (chans <= 0 || rate <= 0) {
273 -diff --git a/src/plugins/mp4/mp4ff/README.xmms2 b/src/plugins/mp4/mp4ff/README.xmms2
274 -index c2737c5..8021618 100644
275 ---- a/src/plugins/mp4/mp4ff/README.xmms2
276 -+++ b/src/plugins/mp4/mp4ff/README.xmms2
277 -@@ -12,3 +12,4 @@ Changes:
278 - * Add value_length variable to tag type and use it when adding new item-value pairs,
279 - necessary for cover art since it's binary data and can't be handled as a string
280 - * Add support for Apple Lossless audio files
281 -+ * Add a workaround for supporting higher samplerates.
282 -diff --git a/src/plugins/mp4/mp4ff/mp4ff.c b/src/plugins/mp4/mp4ff/mp4ff.c
283 -index ee7f7fb..b6f0a37 100644
284 ---- a/src/plugins/mp4/mp4ff/mp4ff.c
285 -+++ b/src/plugins/mp4/mp4ff/mp4ff.c
286 -@@ -32,6 +32,8 @@
287 - #include <string.h>
288 - #include "mp4ffint.h"
289 -
290 -+static uint32_t mp4ff_normalize_flawed_sample_rate (uint16_t samplerate);
291 -+
292 - mp4ff_t *mp4ff_open_read(mp4ff_callback_t *f)
293 - {
294 - mp4ff_t *ff = malloc(sizeof(mp4ff_t));
295 -@@ -304,12 +306,39 @@ int32_t mp4ff_num_samples(const mp4ff_t *f, const int32_t track)
296 - return total;
297 - }
298 -
299 -+static uint32_t
300 -+mp4ff_normalize_flawed_sample_rate (uint16_t samplerate)
301 -+{
302 -+ /* A list of common rates can be found at
303 -+ * https://en.wikipedia.org/wiki/Sampling_rate */
304 -+ uint32_t rates[] = {8000, 11025, 16000, 22050, 32000, 44056, 44100,
305 -+ 47250, 48000, 50000, 50400, 88200, 96000, 176400,
306 -+ 192000, 352800, 384000, 0};
307 -+ uint32_t* rate;
308 -+
309 -+ /* First check standard rates. */
310 -+ for (rate = rates; *rate; rate++) {
311 -+ if (*rate == samplerate) {
312 -+ return *rate;
313 -+ }
314 -+ }
315 -+
316 -+ /* No standard rates matching - check if sample rate got truncated when
317 -+ * added to MP4 container */
318 -+ for (rate = rates; *rate; rate++) {
319 -+ if ((*rate & 0x0000FFFF) == samplerate) {
320 -+ return *rate;
321 -+ }
322 -+ }
323 -
324 -+ /* Failed to find a standard rate - we give up returning the original rate */
325 -+ return samplerate;
326 -+}
327 -
328 -
329 - uint32_t mp4ff_get_sample_rate(const mp4ff_t *f, const int32_t track)
330 - {
331 -- return f->track[track]->sampleRate;
332 -+ return mp4ff_normalize_flawed_sample_rate (f->track[track]->sampleRate);
333 - }
334 -
335 - uint32_t mp4ff_get_channel_count(const mp4ff_t * f,const int32_t track)
336
337 diff --git a/media-sound/xmms2/files/xmms2-0.8-audio4-p3.patch b/media-sound/xmms2/files/xmms2-0.8-audio4-p3.patch
338 deleted file mode 100644
339 index a9145c0d3d2..00000000000
340 --- a/media-sound/xmms2/files/xmms2-0.8-audio4-p3.patch
341 +++ /dev/null
342 @@ -1,388 +0,0 @@
343 -commit 4d0682030e20a8ed218f4ff924554f93d276d9ee
344 -Author: Anthony Garcia <lagg@×××××××.com>
345 -Date: Thu Apr 22 16:59:37 2010 -0700
346 -
347 - OTHER: Cleanup
348 -
349 - Re-enabled nellymoser (ffmpeg appears to be okay with it now)
350 -
351 - Fixed possible infinite loop in the code that handles the data (if any)
352 - between the header and tag data.
353 -
354 -diff --git a/src/plugins/avcodec/avcodec.c b/src/plugins/avcodec/avcodec.c
355 -index 6c9fea8..5554056 100644
356 ---- a/src/plugins/avcodec/avcodec.c
357 -+++ b/src/plugins/avcodec/avcodec.c
358 -@@ -90,7 +90,7 @@ xmms_avcodec_plugin_setup (xmms_xform_plugin_t *xform_plugin)
359 - xmms_magic_add ("A/52 (AC-3) header", "audio/x-ffmpeg-ac3",
360 - "0 beshort 0x0b77", NULL);
361 - xmms_magic_add ("DTS header", "audio/x-ffmpeg-dca",
362 -- "0 belong 0x7ffe8001", NULL);
363 -+ "0 belong 0x7ffe8001", NULL);
364 -
365 - xmms_xform_plugin_indata_add (xform_plugin,
366 - XMMS_STREAM_TYPE_MIMETYPE,
367 -@@ -197,7 +197,8 @@ xmms_avcodec_init (xmms_xform_t *xform)
368 - !strcmp (data->codec_id, "adpcm_swf") ||
369 - !strcmp (data->codec_id, "pcm_s16le") ||
370 - !strcmp (data->codec_id, "ac3") ||
371 -- !strcmp (data->codec_id, "dca")) {
372 -+ !strcmp (data->codec_id, "dca") ||
373 -+ !strcmp (data->codec_id, "nellymoser")) {
374 - /* number 1024 taken from libavformat raw.c RAW_PACKET_SIZE */
375 - data->extradata = g_malloc0 (1024);
376 - data->extradata_size = 1024;
377 -diff --git a/src/plugins/flv/flv.c b/src/plugins/flv/flv.c
378 -index 440010c..266fea6 100644
379 ---- a/src/plugins/flv/flv.c
380 -+++ b/src/plugins/flv/flv.c
381 -@@ -25,29 +25,41 @@
382 - * and other info, then data
383 - */
384 - #define FLV_TAG_SIZE 11
385 --/* random constant */
386 - #define FLV_CHUNK_SIZE 4096
387 -
388 --/* let libavcodec take care of swapping sample bytes */
389 --static const gchar *mime_pcm_s16le = "audio/x-ffmpeg-pcm_s16le";
390 --static const gchar *fmt_mime[11] = {
391 -- /* Supported when samples are 8 bit
392 -- * (otherwise there's no way of knowing endianness)
393 -- */
394 -- "audio/pcm",
395 -- "audio/x-ffmpeg-adpcm_swf",
396 -- "audio/mpeg",
397 -- /* if bps is 8 bit u8
398 -- * if bps is 16 bit sle16
399 -- */
400 -- "audio/pcm",
401 -- /* libavcodec can't handle nelly without dying yet */
402 -- /*"audio/x-ffmpeg-nellymoser",
403 -- "audio/x-ffmpeg-nellymoser",
404 -- "audio/x-ffmpeg-nellymoser",*/
405 -- "", "", "",
406 -- "", "", "",
407 -- "audio/aac"
408 -+typedef enum {
409 -+ /* Only u8 bit samples since
410 -+ there's no way to determine endianness
411 -+ */
412 -+ CODEC_PCM_HOST,
413 -+ CODEC_ADPCM,
414 -+ CODEC_MP3,
415 -+ /* 8 bps: unsigned
416 -+ 16 bps: signed
417 -+ */
418 -+ CODEC_PCM_LE,
419 -+ CODEC_NELLYMOSER_16K,
420 -+ CODEC_NELLYMOSER_8K,
421 -+ /* Uses the sample rate in
422 -+ the tag as normal
423 -+ */
424 -+ CODEC_NELLYMOSER,
425 -+ CODEC_AAC = 10
426 -+} xmms_flv_codec_id;
427 -+
428 -+struct xmms_flv_codec_table {
429 -+ xmms_flv_codec_id id;
430 -+ const gchar *mime;
431 -+} static flv_codecs[] = {
432 -+ {CODEC_PCM_HOST, "audio/pcm"},
433 -+ {CODEC_ADPCM, "audio/x-ffmpeg-adpcm_swf"},
434 -+ {CODEC_MP3, "audio/mpeg"},
435 -+ /* Will be audio/x-ffmpeg-pcm_s16le if bps is 16 */
436 -+ {CODEC_PCM_LE, "audio/pcm"},
437 -+ {CODEC_NELLYMOSER_16K, "audio/x-ffmpeg-nellymoser"},
438 -+ {CODEC_NELLYMOSER_8K, "audio/x-ffmpeg-nellymoser"},
439 -+ {CODEC_NELLYMOSER, "audio/x-ffmpeg-nellymoser"},
440 -+ {CODEC_AAC, "audio/aac"}
441 - };
442 -
443 - typedef struct {
444 -@@ -111,23 +123,26 @@ static gboolean
445 - xmms_flv_init (xmms_xform_t *xform)
446 - {
447 - xmms_sample_format_t bps;
448 -- gint readret;
449 -+ gint readret, i;
450 - guint8 channels, flags, format;
451 -- guint8 header[FLV_TAG_SIZE + 5];
452 -- const gchar *mime;
453 -+ guint8 header[FLV_TAG_SIZE + 1];
454 - guint32 dataoffset, samplerate;
455 - xmms_error_t err;
456 - xmms_flv_data_t *flvdata;
457 -+ struct xmms_flv_codec_table *codec = NULL;
458 -+
459 -+ flvdata = g_new0 (xmms_flv_data_t, 1);
460 -+ xmms_xform_private_data_set (xform, flvdata);
461 -
462 - readret = xmms_xform_read (xform, header, FLV_HDR_SIZE, &err);
463 - if (readret != FLV_HDR_SIZE) {
464 - xmms_log_error ("Header read error");
465 -- return FALSE;
466 -+ goto init_err;
467 - }
468 -
469 - if ((header[4] & HAS_AUDIO) != HAS_AUDIO) {
470 - xmms_log_error ("FLV has no audio stream");
471 -- return FALSE;
472 -+ goto init_err;
473 - }
474 -
475 - dataoffset = get_be32 (&header[5]) - FLV_HDR_SIZE;
476 -@@ -140,7 +155,7 @@ xmms_flv_init (xmms_xform_t *xform)
477 - dataoffset : FLV_HDR_SIZE, &err);
478 - if (readret <= 0) {
479 - xmms_log_error ("Error reading header:tag body gap");
480 -- return FALSE;
481 -+ goto init_err;
482 - }
483 -
484 - dataoffset -= readret;
485 -@@ -148,86 +163,99 @@ xmms_flv_init (xmms_xform_t *xform)
486 -
487 - if (next_audio_tag (xform) <= 0) {
488 - xmms_log_error ("Can't find first audio tag");
489 -- return FALSE;
490 -+ goto init_err;
491 - }
492 -
493 -- if (xmms_xform_peek (xform, header, FLV_TAG_SIZE + 5, &err) < FLV_TAG_SIZE + 5) {
494 -+ if (xmms_xform_read (xform, header, FLV_TAG_SIZE + 1, &err) < FLV_TAG_SIZE + 1) {
495 - xmms_log_error ("Can't read first audio tag");
496 -- return FALSE;
497 -+ goto init_err;
498 - }
499 -
500 -- flags = header[FLV_TAG_SIZE + 4];
501 -+ flags = header[11];
502 - XMMS_DBG ("Audio flags: %X", flags);
503 -
504 -- switch (flags&12) {
505 -- case 0: samplerate = 5512; break;
506 -- case 4: samplerate = 11025; break;
507 -- case 8: samplerate = 22050; break;
508 -- case 12: samplerate = 44100; break;
509 -- default: samplerate = 8000; break;
510 -+ format = flags >> 4;
511 -+ for (i = 0; i < G_N_ELEMENTS (flv_codecs); i++) {
512 -+ if (flv_codecs[i].id == format) {
513 -+ codec = &flv_codecs[i];
514 -+ break;
515 -+ }
516 - }
517 -
518 -- if (flags&2) {
519 -- bps = XMMS_SAMPLE_FORMAT_S16;
520 -+ if (flags & 1) {
521 -+ channels = 2;
522 - } else {
523 -- bps = XMMS_SAMPLE_FORMAT_U8;
524 -+ channels = 1;
525 - }
526 -
527 -- if (flags&1) {
528 -- channels = 2;
529 -+ if (flags & 2) {
530 -+ bps = XMMS_SAMPLE_FORMAT_S16;
531 - } else {
532 -- channels = 1;
533 -+ bps = XMMS_SAMPLE_FORMAT_U8;
534 - }
535 -
536 -- format = flags >> 4;
537 -- mime = (format <= 10)? fmt_mime[format] : NULL;
538 -- switch (format) {
539 -- case 0:
540 -- /* If the flv has an HE PCM audio stream, the
541 -- * samples must be unsigned and 8 bits long
542 -- */
543 -- if (bps != XMMS_SAMPLE_FORMAT_U8) {
544 -- xmms_log_error ("Only u8 HE PCM is supported");
545 -- return FALSE;
546 -- }
547 -- break;
548 -- case 3:
549 -- if (bps == XMMS_SAMPLE_FORMAT_S16) {
550 -- mime = mime_pcm_s16le;
551 -- }
552 -- break;
553 -+ switch ((flags & 12) >> 2) {
554 -+ case 0: samplerate = 5512; break;
555 -+ case 1: samplerate = 11025; break;
556 -+ case 2: samplerate = 22050; break;
557 -+ case 3: samplerate = 44100; break;
558 -+ default: samplerate = 8000; break;
559 - }
560 -
561 -- if (mime && *mime) {
562 -- flvdata = g_new0 (xmms_flv_data_t, 1);
563 -+ if (codec) {
564 -+ switch (codec->id) {
565 -+ case CODEC_PCM_HOST:
566 -+ if (bps != XMMS_SAMPLE_FORMAT_U8) {
567 -+ xmms_log_error ("Only u8 HE PCM is supported");
568 -+ goto init_err;
569 -+ }
570 -+ break;
571 -+ case CODEC_PCM_LE:
572 -+ if (bps == XMMS_SAMPLE_FORMAT_S16) {
573 -+ codec->mime = "audio/x-ffmpeg-pcm_s16le";
574 -+ }
575 -+ break;
576 -+ case CODEC_NELLYMOSER_16K:
577 -+ samplerate = 16000;
578 -+ break;
579 -+ case CODEC_NELLYMOSER_8K:
580 -+ samplerate = 8000;
581 -+ break;
582 -+ default:
583 -+ break;
584 -+ }
585 -+
586 - flvdata->format = format;
587 -+ flvdata->last_datasize = get_be24 (&header[1]) - 1;
588 -
589 - XMMS_DBG ("Rate: %d, bps: %d, channels: %d", samplerate,
590 - bps, channels);
591 -
592 -- xmms_xform_private_data_set (xform, flvdata);
593 - xmms_xform_outdata_type_add (xform,
594 - XMMS_STREAM_TYPE_MIMETYPE,
595 -- mime,
596 -- XMMS_STREAM_TYPE_FMT_SAMPLERATE,
597 -- samplerate,
598 -- XMMS_STREAM_TYPE_FMT_FORMAT,
599 -- bps,
600 -- XMMS_STREAM_TYPE_FMT_CHANNELS,
601 -- channels,
602 -- XMMS_STREAM_TYPE_END);
603 -+ codec->mime,
604 -+ XMMS_STREAM_TYPE_FMT_SAMPLERATE,
605 -+ samplerate,
606 -+ XMMS_STREAM_TYPE_FMT_FORMAT,
607 -+ bps,
608 -+ XMMS_STREAM_TYPE_FMT_CHANNELS,
609 -+ channels,
610 -+ XMMS_STREAM_TYPE_END);
611 - return TRUE;
612 - } else {
613 - xmms_log_error ("Unsupported audio format");
614 -- return FALSE;
615 - }
616 -+
617 -+init_err:
618 -+ g_free (flvdata);
619 -+ return FALSE;
620 - }
621 -
622 - static gint
623 - xmms_flv_read (xmms_xform_t *xform, xmms_sample_t *buf, gint len, xmms_error_t *err)
624 - {
625 -- gint ret = 0, thismuch = FLV_TAG_SIZE + 5;
626 -- guint8 header[FLV_TAG_SIZE + 6], gap = 1;
627 -+ gint ret = 0, thismuch = FLV_TAG_SIZE + 1;
628 -+ guint8 header[FLV_TAG_SIZE + 1];
629 - xmms_flv_data_t *data = NULL;
630 -
631 - data = xmms_xform_private_data_get (xform);
632 -@@ -236,12 +264,8 @@ xmms_flv_read (xmms_xform_t *xform, xmms_sample_t *buf, gint len, xmms_error_t *
633 - xmms_xform_auxdata_barrier (xform);
634 - ret = next_audio_tag (xform);
635 - if (ret > 0) {
636 -- if (data->format == 10) {
637 -- thismuch++;
638 -- gap++;
639 -- }
640 - if (xmms_xform_read (xform, header, thismuch, err) == thismuch) {
641 -- data->last_datasize = get_be24 (&header[5]) - gap;
642 -+ data->last_datasize = get_be24 (&header[1]) - 1;
643 - } else {
644 - xmms_log_error ("Need %d bytes", thismuch);
645 - return -1;
646 -@@ -280,40 +304,51 @@ xmms_flv_destroy (xmms_xform_t *xform)
647 - static gint
648 - next_audio_tag (xmms_xform_t *xform)
649 - {
650 -- guint8 header[FLV_TAG_SIZE + 4];
651 -+ guint8 header[FLV_TAG_SIZE];
652 - guint8 dumb[FLV_CHUNK_SIZE];
653 - gint ret = 0;
654 - xmms_error_t err;
655 -- guint32 datasize = 0;
656 -+ xmms_flv_data_t *data;
657 -+
658 -+ data = xmms_xform_private_data_get (xform);
659 -
660 - do {
661 -- /* there's a last 4 bytes at the end of an FLV giving the final
662 -- * tag's size, this isn't an error
663 -- */
664 -- ret = xmms_xform_peek (xform, header, FLV_TAG_SIZE + 4, &err);
665 -- if ((ret < FLV_TAG_SIZE) && (ret > -1)) {
666 -- ret = 0;
667 -- break;
668 -- } else if (ret == -1) {
669 -- xmms_log_error ("%s", xmms_error_message_get (&err));
670 -- break;
671 -- }
672 -+ /* If > 0 assume we're in the middle of a tag's data */
673 -+ if (!data->last_datasize) {
674 -+ /* There are 4 bytes before an actual tag giving
675 -+ the previous tag's size. The first size in an
676 -+ flv is always 0.
677 -+ */
678 -+ if (xmms_xform_read (xform, header, 4, &err) != 4) {
679 -+ xmms_log_error ("Couldn't read last tag size");
680 -+ return -1;
681 -+ }
682 -
683 -- if (header[4] == 8) {
684 -- /* woo audio tag! */
685 -- break;
686 -- }
687 -+ ret = xmms_xform_peek (xform, header, FLV_TAG_SIZE, &err);
688 -+ if ((ret < FLV_TAG_SIZE) && (ret > -1)) {
689 -+ return 0;
690 -+ } else if (ret == -1) {
691 -+ xmms_log_error ("%s", xmms_error_message_get (&err));
692 -+ return ret;
693 -+ }
694 -+
695 -+ if (header[0] == 8) {
696 -+ /* woo audio tag! */
697 -+ break;
698 -+ }
699 -
700 -- ret = xmms_xform_read (xform, header, FLV_TAG_SIZE + 4, &err);
701 -- if (ret <= 0) { return ret; }
702 -+ if ((ret = xmms_xform_read (xform, header, FLV_TAG_SIZE, &err)) <= 0) {
703 -+ return ret;
704 -+ }
705 -
706 -- datasize = get_be24 (&header[5]);
707 -+ data->last_datasize = get_be24 (&header[1]);
708 -+ }
709 -
710 -- while (datasize) {
711 -+ while (data->last_datasize) {
712 - ret = xmms_xform_read (xform, dumb,
713 -- (datasize < FLV_CHUNK_SIZE) ?
714 -- datasize : FLV_CHUNK_SIZE,
715 -- &err);
716 -+ (data->last_datasize < FLV_CHUNK_SIZE) ?
717 -+ data->last_datasize : FLV_CHUNK_SIZE,
718 -+ &err);
719 - if (ret == 0) {
720 - xmms_log_error ("Data field short!");
721 - break;
722 -@@ -323,7 +358,7 @@ next_audio_tag (xmms_xform_t *xform)
723 - break;
724 - }
725 -
726 -- datasize -= ret;
727 -+ data->last_datasize -= ret;
728 - }
729 -
730 - } while (ret);
731
732 diff --git a/media-sound/xmms2/files/xmms2-0.8-audio4-p4.patch b/media-sound/xmms2/files/xmms2-0.8-audio4-p4.patch
733 deleted file mode 100644
734 index 552f202df19..00000000000
735 --- a/media-sound/xmms2/files/xmms2-0.8-audio4-p4.patch
736 +++ /dev/null
737 @@ -1,296 +0,0 @@
738 -commit 4198d9bf5dff517740ed51b22313367f156107e1
739 -Author: Erik Massop <e.massop@××××××.nl>
740 -Date: Sun Dec 22 17:19:30 2013 +0100
741 -
742 - OTHER: Split xmms_avcodec_read, remove some duplicate code
743 -
744 -diff --git a/src/plugins/avcodec/avcodec.c b/src/plugins/avcodec/avcodec.c
745 -index 5b9b606..eed7964 100644
746 ---- a/src/plugins/avcodec/avcodec.c
747 -+++ b/src/plugins/avcodec/avcodec.c
748 -@@ -57,6 +57,9 @@ typedef struct {
749 - static gboolean xmms_avcodec_plugin_setup (xmms_xform_plugin_t *xform_plugin);
750 - static gboolean xmms_avcodec_init (xmms_xform_t *xform);
751 - static void xmms_avcodec_destroy (xmms_xform_t *xform);
752 -+static gint xmms_avcodec_internal_read_some (xmms_xform_t *xform, xmms_avcodec_data_t *data, xmms_error_t *error);
753 -+static gint xmms_avcodec_internal_decode_some (xmms_avcodec_data_t *data);
754 -+static void xmms_avcodec_internal_append (xmms_avcodec_data_t *data);
755 - static gint xmms_avcodec_read (xmms_xform_t *xform, xmms_sample_t *buf, gint len,
756 - xmms_error_t *error);
757 - static gint64 xmms_avcodec_seek (xmms_xform_t *xform, gint64 samples,
758 -@@ -281,101 +284,24 @@ xmms_avcodec_read (xmms_xform_t *xform, xmms_sample_t *buf, gint len,
759 - xmms_error_t *error)
760 - {
761 - xmms_avcodec_data_t *data;
762 -- gint bytes_read = 0;
763 - guint size;
764 -
765 - data = xmms_xform_private_data_get (xform);
766 - g_return_val_if_fail (data, -1);
767 -
768 -- size = MIN (data->outbuf->len, len);
769 -- while (size == 0) {
770 -- AVPacket packet;
771 -- av_init_packet (&packet);
772 -+ while (0 == (size = MIN (data->outbuf->len, len))) {
773 -+ gint res;
774 -
775 - if (data->no_demuxer || data->buffer_length == 0) {
776 -- gint read_total;
777 --
778 -- bytes_read = xmms_xform_read (xform,
779 -- (gchar *) (data->buffer + data->buffer_length),
780 -- data->buffer_size - data->buffer_length,
781 -- error);
782 --
783 -- if (bytes_read < 0) {
784 -- XMMS_DBG ("Error while reading data");
785 -- return bytes_read;
786 -- } else if (bytes_read == 0) {
787 -- XMMS_DBG ("EOF");
788 -- return 0;
789 -- }
790 --
791 -- read_total = bytes_read;
792 --
793 -- /* If we have a demuxer plugin, make sure we read the whole packet */
794 -- while (read_total == data->buffer_size && !data->no_demuxer) {
795 -- /* multiply the buffer size and try to read again */
796 -- data->buffer = g_realloc (data->buffer, data->buffer_size * 2);
797 -- bytes_read = xmms_xform_read (xform,
798 -- (gchar *) data->buffer +
799 -- data->buffer_size,
800 -- data->buffer_size,
801 -- error);
802 -- data->buffer_size *= 2;
803 --
804 -- if (bytes_read < 0) {
805 -- XMMS_DBG ("Error while reading data");
806 -- return bytes_read;
807 -- }
808 --
809 -- read_total += bytes_read;
810 --
811 -- if (read_total < data->buffer_size) {
812 -- /* finally double the buffer size for performance reasons, the
813 -- * hotspot handling likes to fit two frames in the buffer */
814 -- data->buffer = g_realloc (data->buffer, data->buffer_size * 2);
815 -- data->buffer_size *= 2;
816 -- XMMS_DBG ("Reallocated avcodec internal buffer to be %d bytes",
817 -- data->buffer_size);
818 --
819 -- break;
820 -- }
821 -- }
822 --
823 -- /* Update the buffer length */
824 -- data->buffer_length += read_total;
825 -- }
826 --
827 -- packet.data = data->buffer;
828 -- packet.size = data->buffer_length;
829 --
830 -- data->read_out_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
831 -- bytes_read = avcodec_decode_audio3 (data->codecctx, (short *) data->read_out_buffer,
832 -- &data->read_out_buffer_size, &packet);
833 -+ gint bytes_read;
834 -
835 -- /* The DTS decoder of ffmpeg is buggy and always returns
836 -- * the input buffer length, get frame length from header */
837 -- if (!strcmp (data->codec_id, "dca") && bytes_read > 0) {
838 -- bytes_read = ((int)data->buffer[5] << 12) |
839 -- ((int)data->buffer[6] << 4) |
840 -- ((int)data->buffer[7] >> 4);
841 -- bytes_read = (bytes_read & 0x3fff) + 1;
842 -+ bytes_read = xmms_avcodec_internal_read_some (xform, data, error);
843 -+ if (bytes_read <= 0) { return bytes_read; }
844 - }
845 -
846 -- if (bytes_read < 0 || bytes_read > data->buffer_length) {
847 -- XMMS_DBG ("Error decoding data!");
848 -- return -1;
849 -- } else if (bytes_read != data->buffer_length) {
850 -- g_memmove (data->buffer,
851 -- data->buffer + bytes_read,
852 -- data->buffer_length - bytes_read);
853 -- }
854 --
855 -- data->buffer_length -= bytes_read;
856 --
857 -- if (data->read_out_buffer_size > 0) {
858 -- g_string_append_len (data->outbuf, data->read_out_buffer, data->read_out_buffer_size);
859 -- }
860 --
861 -- size = MIN (data->outbuf->len, len);
862 -+ res = xmms_avcodec_internal_decode_some (data);
863 -+ if (res < 0) { return res; }
864 -+ if (res > 0) { xmms_avcodec_internal_append (data); }
865 - }
866 -
867 - memcpy (buf, data->outbuf->str, size);
868 -@@ -388,7 +314,6 @@ static gint64
869 - xmms_avcodec_seek (xmms_xform_t *xform, gint64 samples, xmms_xform_seek_mode_t whence, xmms_error_t *err)
870 - {
871 - xmms_avcodec_data_t *data;
872 -- gint bytes_read = 0;
873 - gint64 ret = -1;
874 -
875 - g_return_val_if_fail (xform, -1);
876 -@@ -406,23 +331,11 @@ xmms_avcodec_seek (xmms_xform_t *xform, gint64 samples, xmms_xform_seek_mode_t w
877 -
878 - /* The buggy ape decoder doesn't flush buffers, so we need to finish decoding
879 - * the frame before seeking to avoid segfaults... this hack sucks */
880 -+ /* FIXME: Is ^^^ still true? */
881 - while (data->buffer_length > 0) {
882 -- AVPacket packet;
883 -- av_init_packet (&packet);
884 -- packet.data = data->buffer;
885 -- packet.size = data->buffer_length;
886 --
887 -- data->read_out_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
888 -- bytes_read = avcodec_decode_audio3 (data->codecctx, (short *) data->read_out_buffer,
889 -- &data->read_out_buffer_size, &packet);
890 --
891 -- if (bytes_read < 0 || bytes_read > data->buffer_length) {
892 -- XMMS_DBG ("Error decoding data!");
893 -+ if (xmms_avcodec_internal_decode_some (data) < 0) {
894 - return -1;
895 - }
896 --
897 -- data->buffer_length -= bytes_read;
898 -- g_memmove (data->buffer, data->buffer + bytes_read, data->buffer_length);
899 - }
900 -
901 - ret = xmms_xform_seek (xform, samples, whence, err);
902 -@@ -456,3 +369,131 @@ xmms_avcodec_translate_sample_format (enum AVSampleFormat av_sample_format)
903 - return XMMS_SAMPLE_FORMAT_UNKNOWN;
904 - }
905 - }
906 -+
907 -+/*
908 -+Read some data from our source of data to data->buffer, updating buffer_length
909 -+and buffer_size as needed.
910 -+
911 -+Returns: on error: negative
912 -+ on EOF: zero
913 -+ otherwise: number of bytes read.
914 -+*/
915 -+static gint
916 -+xmms_avcodec_internal_read_some (xmms_xform_t *xform,
917 -+ xmms_avcodec_data_t *data,
918 -+ xmms_error_t *error)
919 -+{
920 -+ gint bytes_read, read_total;
921 -+
922 -+ bytes_read = xmms_xform_read (xform,
923 -+ (gchar *) (data->buffer + data->buffer_length),
924 -+ data->buffer_size - data->buffer_length,
925 -+ error);
926 -+
927 -+ if (bytes_read < 0) {
928 -+ XMMS_DBG ("Error while reading data");
929 -+ return bytes_read;
930 -+ } else if (bytes_read == 0) {
931 -+ XMMS_DBG ("EOF");
932 -+ return 0;
933 -+ }
934 -+
935 -+ read_total = bytes_read;
936 -+
937 -+ /* If we have a demuxer plugin, make sure we read the whole packet */
938 -+ while (read_total == data->buffer_size && !data->no_demuxer) {
939 -+ /* multiply the buffer size and try to read again */
940 -+ data->buffer = g_realloc (data->buffer, data->buffer_size * 2);
941 -+ bytes_read = xmms_xform_read (xform,
942 -+ (gchar *) data->buffer +
943 -+ data->buffer_size,
944 -+ data->buffer_size,
945 -+ error);
946 -+ data->buffer_size *= 2;
947 -+
948 -+ if (bytes_read < 0) {
949 -+ XMMS_DBG ("Error while reading data");
950 -+ return bytes_read;
951 -+ }
952 -+
953 -+ read_total += bytes_read;
954 -+
955 -+ if (read_total < data->buffer_size) {
956 -+ /* finally double the buffer size for performance reasons, the
957 -+ * hotspot handling likes to fit two frames in the buffer */
958 -+ data->buffer = g_realloc (data->buffer, data->buffer_size * 2);
959 -+ data->buffer_size *= 2;
960 -+ XMMS_DBG ("Reallocated avcodec internal buffer to be %d bytes",
961 -+ data->buffer_size);
962 -+
963 -+ break;
964 -+ }
965 -+ }
966 -+
967 -+ /* Update the buffer length */
968 -+ data->buffer_length += read_total;
969 -+
970 -+ return read_total;
971 -+}
972 -+
973 -+/*
974 -+Decode some data from data->buffer[0..data->buffer_length-1] to
975 -+data->read_out_buffer. Number of bytes in data->read_out_buffer
976 -+is stored in data->read_out_buffer_size.
977 -+
978 -+Returns: on error: negative
979 -+ on no new data produced: zero
980 -+ otherwise: positive
981 -+
982 -+FIXME: data->buffer should be at least data->buffer_length +
983 -+FF_INPUT_BUFFER_PADDING_SIZE long.
984 -+*/
985 -+static gint
986 -+xmms_avcodec_internal_decode_some (xmms_avcodec_data_t *data)
987 -+{
988 -+ gint bytes_read = 0;
989 -+ AVPacket packet;
990 -+
991 -+ av_init_packet (&packet);
992 -+ packet.data = data->buffer;
993 -+ packet.size = data->buffer_length;
994 -+
995 -+ data->read_out_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
996 -+ bytes_read = avcodec_decode_audio3 (data->codecctx,
997 -+ (short *) data->read_out_buffer,
998 -+ &data->read_out_buffer_size, &packet);
999 -+
1000 -+ /* The DTS decoder of ffmpeg is buggy and always returns
1001 -+ * the input buffer length, get frame length from header */
1002 -+ /* FIXME: Is ^^^^ still true? */
1003 -+ if (!strcmp (data->codec_id, "dca") && bytes_read > 0) {
1004 -+ bytes_read = ((int)data->buffer[5] << 12) |
1005 -+ ((int)data->buffer[6] << 4) |
1006 -+ ((int)data->buffer[7] >> 4);
1007 -+ bytes_read = (bytes_read & 0x3fff) + 1;
1008 -+ }
1009 -+
1010 -+ if (bytes_read < 0 || bytes_read > data->buffer_length) {
1011 -+ XMMS_DBG ("Error decoding data!");
1012 -+ return -1;
1013 -+ }
1014 -+
1015 -+ if (bytes_read < data->buffer_length) {
1016 -+ data->buffer_length -= bytes_read;
1017 -+ g_memmove (data->buffer,
1018 -+ data->buffer + bytes_read,
1019 -+ data->buffer_length);
1020 -+ } else {
1021 -+ data->buffer_length = 0;
1022 -+ }
1023 -+
1024 -+ return data->read_out_buffer_size;
1025 -+}
1026 -+
1027 -+static void
1028 -+xmms_avcodec_internal_append (xmms_avcodec_data_t *data)
1029 -+{
1030 -+ g_string_append_len (data->outbuf,
1031 -+ (gchar *) data->read_out_buffer,
1032 -+ data->read_out_buffer_size);
1033 -+}
1034
1035 diff --git a/media-sound/xmms2/files/xmms2-0.8-audio4-p5.patch b/media-sound/xmms2/files/xmms2-0.8-audio4-p5.patch
1036 deleted file mode 100644
1037 index 8ed5bb4a24a..00000000000
1038 --- a/media-sound/xmms2/files/xmms2-0.8-audio4-p5.patch
1039 +++ /dev/null
1040 @@ -1,154 +0,0 @@
1041 -commit d44312fb14bde0ab47ee6de1b3fe7435d4a97c99
1042 -Author: Erik Massop <e.massop@××××××.nl>
1043 -Date: Sun Dec 22 20:01:18 2013 +0100
1044 -
1045 - BUG(2572): Use avcodec_decode_audio4
1046 -
1047 -diff --git a/src/plugins/avcodec/avcodec.c b/src/plugins/avcodec/avcodec.c
1048 -index 266a607..a41a675 100644
1049 ---- a/src/plugins/avcodec/avcodec.c
1050 -+++ b/src/plugins/avcodec/avcodec.c
1051 -@@ -37,8 +37,7 @@ typedef struct {
1052 - guint buffer_size;
1053 - gboolean no_demuxer;
1054 -
1055 -- gchar *read_out_buffer;
1056 -- gint read_out_buffer_size;
1057 -+ AVFrame *read_out_frame;
1058 -
1059 - guint channels;
1060 - guint samplerate;
1061 -@@ -125,7 +124,7 @@ xmms_avcodec_destroy (xmms_xform_t *xform)
1062 -
1063 - avcodec_close (data->codecctx);
1064 - av_free (data->codecctx);
1065 -- av_free (data->read_out_buffer);
1066 -+ avcodec_free_frame (&data->read_out_frame);
1067 -
1068 - g_string_free (data->outbuf, TRUE);
1069 - g_free (data->buffer);
1070 -@@ -151,8 +150,7 @@ xmms_avcodec_init (xmms_xform_t *xform)
1071 - data->buffer_size = AVCODEC_BUFFER_SIZE;
1072 - data->codecctx = NULL;
1073 -
1074 -- data->read_out_buffer = av_malloc (AVCODEC_MAX_AUDIO_FRAME_SIZE);
1075 -- data->read_out_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
1076 -+ data->read_out_frame = avcodec_alloc_frame ();
1077 -
1078 - xmms_xform_private_data_set (xform, data);
1079 -
1080 -@@ -233,6 +231,7 @@ xmms_avcodec_init (xmms_xform_t *xform)
1081 - data->codecctx->extradata_size = data->extradata_size;
1082 - data->codecctx->codec_id = codec->id;
1083 - data->codecctx->codec_type = codec->type;
1084 -+ data->codecctx->refcounted_frames = 0;
1085 -
1086 - if (avcodec_open2 (data->codecctx, codec, NULL) < 0) {
1087 - XMMS_DBG ("Opening decoder '%s' failed", codec->name);
1088 -@@ -279,8 +278,8 @@ err:
1089 - if (data->codecctx) {
1090 - av_free (data->codecctx);
1091 - }
1092 -- if (data->read_out_buffer) {
1093 -- av_free (data->read_out_buffer);
1094 -+ if (data->read_out_frame) {
1095 -+ avcodec_free_frame (&data->read_out_frame);
1096 - }
1097 - g_string_free (data->outbuf, TRUE);
1098 - g_free (data->extradata);
1099 -@@ -365,17 +364,23 @@ xmms_avcodec_translate_sample_format (enum AVSampleFormat av_sample_format)
1100 - {
1101 - switch (av_sample_format) {
1102 - case AV_SAMPLE_FMT_U8:
1103 -+ case AV_SAMPLE_FMT_U8P:
1104 - return XMMS_SAMPLE_FORMAT_U8;
1105 - case AV_SAMPLE_FMT_S16:
1106 -+ case AV_SAMPLE_FMT_S16P:
1107 - return XMMS_SAMPLE_FORMAT_S16;
1108 - case AV_SAMPLE_FMT_S32:
1109 -+ case AV_SAMPLE_FMT_S32P:
1110 - return XMMS_SAMPLE_FORMAT_S32;
1111 - case AV_SAMPLE_FMT_FLT:
1112 -+ case AV_SAMPLE_FMT_FLTP:
1113 - return XMMS_SAMPLE_FORMAT_FLOAT;
1114 - case AV_SAMPLE_FMT_DBL:
1115 -+ case AV_SAMPLE_FMT_DBLP:
1116 - return XMMS_SAMPLE_FORMAT_DOUBLE;
1117 - default:
1118 -- XMMS_DBG ("AVSampleFormat (%i) not supported.", av_sample_format);
1119 -+ XMMS_DBG ("AVSampleFormat (%i: %s) not supported.", av_sample_format,
1120 -+ av_get_sample_fmt_name (av_sample_format));
1121 - return XMMS_SAMPLE_FORMAT_UNKNOWN;
1122 - }
1123 - }
1124 -@@ -448,8 +453,7 @@ xmms_avcodec_internal_read_some (xmms_xform_t *xform,
1125 -
1126 - /*
1127 - Decode some data from data->buffer[0..data->buffer_length-1] to
1128 --data->read_out_buffer. Number of bytes in data->read_out_buffer
1129 --is stored in data->read_out_buffer_size.
1130 -+data->read_out_frame
1131 -
1132 - Returns: on error: negative
1133 - on no new data produced: zero
1134 -@@ -461,6 +465,7 @@ FF_INPUT_BUFFER_PADDING_SIZE long.
1135 - static gint
1136 - xmms_avcodec_internal_decode_some (xmms_avcodec_data_t *data)
1137 - {
1138 -+ int got_frame = 0;
1139 - gint bytes_read = 0;
1140 - AVPacket packet;
1141 -
1142 -@@ -468,10 +473,10 @@ xmms_avcodec_internal_decode_some (xmms_avcodec_data_t *data)
1143 - packet.data = data->buffer;
1144 - packet.size = data->buffer_length;
1145 -
1146 -- data->read_out_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
1147 -- bytes_read = avcodec_decode_audio3 (data->codecctx,
1148 -- (short *) data->read_out_buffer,
1149 -- &data->read_out_buffer_size, &packet);
1150 -+ avcodec_get_frame_defaults (data->read_out_frame);
1151 -+
1152 -+ bytes_read = avcodec_decode_audio4 (
1153 -+ data->codecctx, data->read_out_frame, &got_frame, &packet);
1154 -
1155 - /* The DTS decoder of ffmpeg is buggy and always returns
1156 - * the input buffer length, get frame length from header */
1157 -@@ -497,13 +502,33 @@ xmms_avcodec_internal_decode_some (xmms_avcodec_data_t *data)
1158 - data->buffer_length = 0;
1159 - }
1160 -
1161 -- return data->read_out_buffer_size;
1162 -+ return got_frame ? 1 : 0;
1163 - }
1164 -
1165 - static void
1166 - xmms_avcodec_internal_append (xmms_avcodec_data_t *data)
1167 - {
1168 -- g_string_append_len (data->outbuf,
1169 -- (gchar *) data->read_out_buffer,
1170 -- data->read_out_buffer_size);
1171 -+ enum AVSampleFormat fmt = (enum AVSampleFormat) data->read_out_frame->format;
1172 -+ int samples = data->read_out_frame->nb_samples;
1173 -+ int channels = data->codecctx->channels;
1174 -+ int bps = av_get_bytes_per_sample (fmt);
1175 -+
1176 -+ if (av_sample_fmt_is_planar (fmt)) {
1177 -+ /* Convert from planar to packed format */
1178 -+ gint i, j;
1179 -+
1180 -+ for (i = 0; i < samples; i++) {
1181 -+ for (j = 0; j < channels; j++) {
1182 -+ g_string_append_len (
1183 -+ data->outbuf,
1184 -+ (gchar *) (data->read_out_frame->extended_data[j] + i*bps),
1185 -+ bps
1186 -+ );
1187 -+ }
1188 -+ }
1189 -+ } else {
1190 -+ g_string_append_len (data->outbuf,
1191 -+ (gchar *) data->read_out_frame->extended_data[0],
1192 -+ samples * channels * bps);
1193 -+ }
1194 - }
1195
1196 diff --git a/media-sound/xmms2/files/xmms2-0.8-audio4-p6.patch b/media-sound/xmms2/files/xmms2-0.8-audio4-p6.patch
1197 deleted file mode 100644
1198 index b1bc1c5d609..00000000000
1199 --- a/media-sound/xmms2/files/xmms2-0.8-audio4-p6.patch
1200 +++ /dev/null
1201 @@ -1,106 +0,0 @@
1202 -commit fc66249e69f53eef709c5210546fdd92e1c89554
1203 -Author: Erik Massop <e.massop@××××××.nl>
1204 -Date: Sun Dec 22 23:04:08 2013 +0100
1205 -
1206 - OTHER: Some compatibility with different avcodec versions
1207 -
1208 -diff --git a/src/plugins/avcodec/avcodec.c b/src/plugins/avcodec/avcodec.c
1209 -index a41a675..023833d 100644
1210 ---- a/src/plugins/avcodec/avcodec.c
1211 -+++ b/src/plugins/avcodec/avcodec.c
1212 -@@ -124,7 +124,7 @@ xmms_avcodec_destroy (xmms_xform_t *xform)
1213 -
1214 - avcodec_close (data->codecctx);
1215 - av_free (data->codecctx);
1216 -- avcodec_free_frame (&data->read_out_frame);
1217 -+ av_frame_free (&data->read_out_frame);
1218 -
1219 - g_string_free (data->outbuf, TRUE);
1220 - g_free (data->buffer);
1221 -@@ -150,7 +150,7 @@ xmms_avcodec_init (xmms_xform_t *xform)
1222 - data->buffer_size = AVCODEC_BUFFER_SIZE;
1223 - data->codecctx = NULL;
1224 -
1225 -- data->read_out_frame = avcodec_alloc_frame ();
1226 -+ data->read_out_frame = av_frame_alloc ();
1227 -
1228 - xmms_xform_private_data_set (xform, data);
1229 -
1230 -@@ -231,7 +231,6 @@ xmms_avcodec_init (xmms_xform_t *xform)
1231 - data->codecctx->extradata_size = data->extradata_size;
1232 - data->codecctx->codec_id = codec->id;
1233 - data->codecctx->codec_type = codec->type;
1234 -- data->codecctx->refcounted_frames = 0;
1235 -
1236 - if (avcodec_open2 (data->codecctx, codec, NULL) < 0) {
1237 - XMMS_DBG ("Opening decoder '%s' failed", codec->name);
1238 -@@ -473,7 +472,8 @@ xmms_avcodec_internal_decode_some (xmms_avcodec_data_t *data)
1239 - packet.data = data->buffer;
1240 - packet.size = data->buffer_length;
1241 -
1242 -- avcodec_get_frame_defaults (data->read_out_frame);
1243 -+ /* clear buffers and reset fields to defaults */
1244 -+ av_frame_unref (data->read_out_frame);
1245 -
1246 - bytes_read = avcodec_decode_audio4 (
1247 - data->codecctx, data->read_out_frame, &got_frame, &packet);
1248 -diff --git a/src/plugins/avcodec/avcodec_compat.h b/src/plugins/avcodec/avcodec_compat.h
1249 -index 73ac2ab..e74b3f8 100644
1250 ---- a/src/plugins/avcodec/avcodec_compat.h
1251 -+++ b/src/plugins/avcodec/avcodec_compat.h
1252 -@@ -83,3 +83,17 @@ typedef struct AVPacket {
1253 - # define avcodec_open2(avctx, codec, options) \
1254 - avcodec_open(avctx, codec)
1255 - #endif
1256 -+
1257 -+/* Map avcodec_free_frame to av_freep if the former doesn't exist.
1258 -+ * (This is in versions earlier than 54.28.0 (libav) or 54.59.100 (ffmpeg)) */
1259 -+#if ! HAVE_AVCODEC_FREE_FRAME
1260 -+# define avcodec_free_frame av_freep
1261 -+#endif
1262 -+
1263 -+/* Map av_frame_alloc, av_frame_unref, av_frame_free into their
1264 -+ * deprecated versions in versions earlier than 55.28.1 */
1265 -+#if LIBAVCODEC_VERSION_INT < 0x371c01
1266 -+# define av_frame_alloc avcodec_alloc_frame
1267 -+# define av_frame_unref avcodec_get_frame_defaults
1268 -+# define av_frame_free avcodec_free_frame
1269 -+#endif
1270 -diff --git a/src/plugins/avcodec/wscript b/src/plugins/avcodec/wscript
1271 -index 03ba7d8..d367816 100644
1272 ---- a/src/plugins/avcodec/wscript
1273 -+++ b/src/plugins/avcodec/wscript
1274 -@@ -1,10 +1,33 @@
1275 - from waftools.plugin import plugin
1276 -
1277 -+## Code fragments for configuration
1278 -+avcodec_free_frame_fragment = """
1279 -+#ifdef HAVE_LIBAVCODEC_AVCODEC_H
1280 -+# include "libavcodec/avcodec.h"
1281 -+#else
1282 -+# include "avcodec.h"
1283 -+#endif
1284 -+int main(void) {
1285 -+ AVFrame *frame;
1286 -+
1287 -+ avcodec_free_frame (&frame);
1288 -+
1289 -+ return 0;
1290 -+}
1291 -+"""
1292 -+
1293 - def plugin_configure(conf):
1294 - conf.check_cfg(package="libavcodec", uselib_store="avcodec",
1295 - args="--cflags --libs")
1296 - conf.check_cc(header_name="avcodec.h", uselib="avcodec", type="cshlib", mandatory=False)
1297 - conf.check_cc(header_name="libavcodec/avcodec.h", uselib="avcodec", type="cshlib", mandatory=False)
1298 -
1299 -+ # non-mandatory function avcodec_free_frame since
1300 -+ # * ffmpeg: commit 46a3595, lavc 54.59.100, release 1.0
1301 -+ # * libav: commit a42aada, lavc 54.28.0, release 9
1302 -+ conf.check_cc(fragment=avcodec_free_frame_fragment, uselib="avcodec",
1303 -+ uselib_store="avcodec_free_frame",
1304 -+ msg="Checking for function avcodec_free_frame", mandatory=False)
1305 -+
1306 - configure, build = plugin('avcodec', configure=plugin_configure,
1307 - libs=["avcodec"])
1308
1309 diff --git a/media-sound/xmms2/files/xmms2-0.8-audio4-p7.patch b/media-sound/xmms2/files/xmms2-0.8-audio4-p7.patch
1310 deleted file mode 100644
1311 index 2d4bafd95a7..00000000000
1312 --- a/media-sound/xmms2/files/xmms2-0.8-audio4-p7.patch
1313 +++ /dev/null
1314 @@ -1,147 +0,0 @@
1315 -commit f460440b3f2a9db1a9deef3faf7dae6e626dd7b5
1316 -Author: Erik Massop <e.massop@××××××.nl>
1317 -Date: Sun Dec 22 23:34:12 2013 +0100
1318 -
1319 - OTHER: Require avcodec_decode_audio4
1320 -
1321 - This was introduced in versions 53.40.0 (ffmpeg) and 53.25.0 (libav) of
1322 - avcodec. Hence we drop compatibility for earlier versions.
1323 -
1324 -diff --git a/src/plugins/avcodec/avcodec.c b/src/plugins/avcodec/avcodec.c
1325 -index 023833d..6d0b667 100644
1326 ---- a/src/plugins/avcodec/avcodec.c
1327 -+++ b/src/plugins/avcodec/avcodec.c
1328 -@@ -154,7 +154,6 @@ xmms_avcodec_init (xmms_xform_t *xform)
1329 -
1330 - xmms_xform_private_data_set (xform, data);
1331 -
1332 -- avcodec_init ();
1333 - avcodec_register_all ();
1334 -
1335 - mimetype = xmms_xform_indata_get_str (xform,
1336 -@@ -225,7 +224,7 @@ xmms_avcodec_init (xmms_xform_t *xform)
1337 - data->codecctx->sample_rate = data->samplerate;
1338 - data->codecctx->channels = data->channels;
1339 - data->codecctx->bit_rate = data->bitrate;
1340 -- CONTEXT_BPS (data->codecctx) = data->samplebits;
1341 -+ data->codecctx->bits_per_coded_sample = data->samplebits;
1342 - data->codecctx->block_align = data->block_align;
1343 - data->codecctx->extradata = data->extradata;
1344 - data->codecctx->extradata_size = data->extradata_size;
1345 -diff --git a/src/plugins/avcodec/avcodec_compat.h b/src/plugins/avcodec/avcodec_compat.h
1346 -index e74b3f8..b50fa4b 100644
1347 ---- a/src/plugins/avcodec/avcodec_compat.h
1348 -+++ b/src/plugins/avcodec/avcodec_compat.h
1349 -@@ -21,69 +21,6 @@
1350 - # include "avcodec.h"
1351 - #endif
1352 -
1353 --/* Map avcodec_decode_audio2 into the deprecated version
1354 -- * avcodec_decode_audio in versions earlier than 51.28 */
1355 --#if LIBAVCODEC_VERSION_INT < 0x331c00
1356 --# define avcodec_decode_audio2 avcodec_decode_audio
1357 --#endif
1358 --
1359 --/* Handle API change that happened in libavcodec 52.00 */
1360 --#if LIBAVCODEC_VERSION_INT < 0x340000
1361 --# define CONTEXT_BPS(codecctx) (codecctx)->bits_per_sample
1362 --#else
1363 --# define CONTEXT_BPS(codecctx) (codecctx)->bits_per_coded_sample
1364 --#endif
1365 --
1366 --/* Before 52.23 AVPacket was defined in avformat.h which we
1367 -- * do not want to depend on, so we define part of it manually
1368 -- * on versions smaller than 52.23 (this makes me cry) */
1369 --#if LIBAVCODEC_VERSION_INT < 0x341700
1370 --typedef struct AVPacket {
1371 -- uint8_t *data;
1372 -- int size;
1373 --} AVPacket;
1374 --#endif
1375 --
1376 --/* Same thing as above for av_init_packet and version 52.25 */
1377 --#if LIBAVCODEC_VERSION_INT < 0x341900
1378 --# define av_init_packet(pkt) do { \
1379 -- (pkt)->data = NULL; \
1380 -- (pkt)->size = 0; \
1381 -- } while(0)
1382 --#endif
1383 --
1384 --/* Map avcodec_decode_audio3 into the deprecated version
1385 -- * avcodec_decode_audio2 in versions earlier than 52.26 */
1386 --#if LIBAVCODEC_VERSION_INT < 0x341a00
1387 --# define avcodec_decode_audio3(avctx, samples, frame_size_ptr, avpkt) \
1388 -- avcodec_decode_audio2(avctx, samples, frame_size_ptr, \
1389 -- (avpkt)->data, (avpkt)->size)
1390 --#endif
1391 --
1392 --/* Handle API change that happened in libavcodec 52.64 */
1393 --#if LIBAVCODEC_VERSION_INT < 0x344000
1394 --# define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO
1395 --#endif
1396 --
1397 --/* Calling avcodec_init is not necessary after 53.04 (ffmpeg 0.9) */
1398 --#if LIBAVCODEC_VERSION_INT >= 0x350400
1399 --# define avcodec_init()
1400 --#endif
1401 --
1402 --/* Map avcodec_alloc_context3 into the deprecated version
1403 -- * avcodec_alloc_context in versions earlier than 53.04 (ffmpeg 0.9) */
1404 --#if LIBAVCODEC_VERSION_INT < 0x350400
1405 --# define avcodec_alloc_context3(codec) \
1406 -- avcodec_alloc_context()
1407 --#endif
1408 --
1409 --/* Map avcodec_open2 into the deprecated version
1410 -- * avcodec_open in versions earlier than 53.04 (ffmpeg 0.9) */
1411 --#if LIBAVCODEC_VERSION_INT < 0x350400
1412 --# define avcodec_open2(avctx, codec, options) \
1413 -- avcodec_open(avctx, codec)
1414 --#endif
1415 --
1416 - /* Map avcodec_free_frame to av_freep if the former doesn't exist.
1417 - * (This is in versions earlier than 54.28.0 (libav) or 54.59.100 (ffmpeg)) */
1418 - #if ! HAVE_AVCODEC_FREE_FRAME
1419 -diff --git a/src/plugins/avcodec/wscript b/src/plugins/avcodec/wscript
1420 -index d367816..00b182b 100644
1421 ---- a/src/plugins/avcodec/wscript
1422 -+++ b/src/plugins/avcodec/wscript
1423 -@@ -1,6 +1,24 @@
1424 - from waftools.plugin import plugin
1425 -
1426 - ## Code fragments for configuration
1427 -+avcodec_decode_audio4_fragment = """
1428 -+#ifdef HAVE_LIBAVCODEC_AVCODEC_H
1429 -+# include "libavcodec/avcodec.h"
1430 -+#else
1431 -+# include "avcodec.h"
1432 -+#endif
1433 -+int main(void) {
1434 -+ AVCodecContext *ctx;
1435 -+ AVFrame *frame;
1436 -+ int got_frame;
1437 -+ AVPacket *pkt;
1438 -+
1439 -+ avcodec_decode_audio4 (ctx, frame, &got_frame, pkt);
1440 -+
1441 -+ return 0;
1442 -+}
1443 -+"""
1444 -+
1445 - avcodec_free_frame_fragment = """
1446 - #ifdef HAVE_LIBAVCODEC_AVCODEC_H
1447 - # include "libavcodec/avcodec.h"
1448 -@@ -22,6 +40,13 @@ def plugin_configure(conf):
1449 - conf.check_cc(header_name="avcodec.h", uselib="avcodec", type="cshlib", mandatory=False)
1450 - conf.check_cc(header_name="libavcodec/avcodec.h", uselib="avcodec", type="cshlib", mandatory=False)
1451 -
1452 -+ # mandatory function avcodec_decode_audio4 available since
1453 -+ # * ffmpeg: commit e4de716, lavc 53.40.0, release 0.9
1454 -+ # * libav: commit 0eea212, lavc 53.25.0, release 0.8
1455 -+ conf.check_cc(fragment=avcodec_decode_audio4_fragment, uselib="avcodec",
1456 -+ uselib_store="avcodec_decode_audio4",
1457 -+ msg="Checking for function avcodec_decode_audio4", mandatory=True)
1458 -+
1459 - # non-mandatory function avcodec_free_frame since
1460 - # * ffmpeg: commit 46a3595, lavc 54.59.100, release 1.0
1461 - # * libav: commit a42aada, lavc 54.28.0, release 9
1462
1463 diff --git a/media-sound/xmms2/files/xmms2-0.8-cpython.patch b/media-sound/xmms2/files/xmms2-0.8-cpython.patch
1464 deleted file mode 100644
1465 index 58227ba5db8..00000000000
1466 --- a/media-sound/xmms2/files/xmms2-0.8-cpython.patch
1467 +++ /dev/null
1468 @@ -1,9 +0,0 @@
1469 -diff --git a/src/clients/lib/python/cython_include/cxmmsclient.pxd b/src/clients/lib/python/cython_include/cxmmsclient.pxd
1470 -index 66390a7..629bc7f 100644
1471 ---- a/src/clients/lib/python/cython_include/cxmmsclient.pxd
1472 -+++ b/src/clients/lib/python/cython_include/cxmmsclient.pxd
1473 -@@ -30,3 +30,3 @@ cdef extern from "xmmsc/xmmsc_idnumbers.h":
1474 -
1475 -- ctypedef enum xmmsc_collection_changed_actions_t:
1476 -+ ctypedef enum xmms_collection_changed_actions_t:
1477 - XMMS_COLLECTION_CHANGED_ADD
1478
1479 diff --git a/media-sound/xmms2/files/xmms2-0.8-cython-0.19.1.patch b/media-sound/xmms2/files/xmms2-0.8-cython-0.19.1.patch
1480 deleted file mode 100644
1481 index 1d6e59f6c83..00000000000
1482 --- a/media-sound/xmms2/files/xmms2-0.8-cython-0.19.1.patch
1483 +++ /dev/null
1484 @@ -1,47 +0,0 @@
1485 -From 6d6d7a7ee38c8e3f57242f2510e06a03f4e7e249 Mon Sep 17 00:00:00 2001
1486 -From: Sergei Trofimovich <slyfox@g.o>
1487 -Date: Mon, 5 Aug 2013 22:29:46 +0300
1488 -Subject: [PATCH] unbreak xmms2 building on cython-0.19.1
1489 -
1490 -Error compiling Cython file:
1491 -------------------------------------------------------------
1492 -...
1493 - def medialib_path_import(self, path, cb = None, encoded=False):
1494 - """
1495 - @deprecated
1496 - Use medialib_import_path(path, ...) instead
1497 - """
1498 - return self.medialib_import_path(self, path, cb=cb, encoded=encoded)
1499 - ^
1500 -
1501 -Reported-by: ChunFeng
1502 -Signed-off-by: Sergei Trofimovich <slyfox@g.o>
1503 ----
1504 - src/clients/lib/python/xmmsapi.pyx | 4 ++--
1505 - 1 file changed, 2 insertions(+), 2 deletions(-)
1506 -
1507 -diff --git a/src/clients/lib/python/xmmsapi.pyx b/src/clients/lib/python/xmmsapi.pyx
1508 -index 501a068..863db88 100644
1509 ---- a/src/clients/lib/python/xmmsapi.pyx
1510 -+++ b/src/clients/lib/python/xmmsapi.pyx
1511 -@@ -1364,7 +1364,7 @@ cdef class XmmsApi(XmmsCore):
1512 - @deprecated
1513 - Use medialib_import_path(path, ...) instead
1514 - """
1515 -- return self.medialib_import_path(self, path, cb=cb, encoded=encoded)
1516 -+ return self.medialib_import_path(path, cb=cb, encoded=encoded)
1517 -
1518 - @deprecated
1519 - def medialib_path_import_encoded(self, path, cb = None):
1520 -@@ -1372,7 +1372,7 @@ cdef class XmmsApi(XmmsCore):
1521 - @deprecated
1522 - Use medialib_import_path(path, ..., encoded=True) instead
1523 - """
1524 -- return self.medialib_import_path(self, path, cb=cb, encoded=True)
1525 -+ return self.medialib_import_path(path, cb=cb, encoded=True)
1526 -
1527 - cpdef XmmsResult medialib_property_set(self, int id, key, value, source=None, cb=None):
1528 - """
1529 ---
1530 -1.8.3.2
1531 -
1532
1533 diff --git a/media-sound/xmms2/files/xmms2-0.8-ffmpeg-0.11.patch b/media-sound/xmms2/files/xmms2-0.8-ffmpeg-0.11.patch
1534 deleted file mode 100644
1535 index bac2fba7e9f..00000000000
1536 --- a/media-sound/xmms2/files/xmms2-0.8-ffmpeg-0.11.patch
1537 +++ /dev/null
1538 @@ -1,18 +0,0 @@
1539 -commit 8743e0c3a4f06053d89b74e40a362ba4949ed53c
1540 -Author: Juho Vähä-Herttua <juhovh@×××.fi>
1541 -Date: Fri Jun 8 09:30:47 2012 +0300
1542 -
1543 - OTHER: Quick fix to make XMMS2 compile on ffmpeg 0.11
1544 -
1545 -diff --git a/src/plugins/avcodec/avcodec_compat.h b/src/plugins/avcodec/avcodec_compat.h
1546 -index df87b27..f1b1af7 100644
1547 ---- a/src/plugins/avcodec/avcodec_compat.h
1548 -+++ b/src/plugins/avcodec/avcodec_compat.h
1549 -@@ -65,3 +65,7 @@ typedef struct AVPacket {
1550 - # define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO
1551 - #endif
1552 -
1553 -+/* Calling avcodec_init is not necessary after 53.04 (ffmpeg 0.9) */
1554 -+#if LIBAVCODEC_VERSION_INT >= 0x350400
1555 -+# define avcodec_init()
1556 -+#endif
1557
1558 diff --git a/media-sound/xmms2/files/xmms2-0.8-libav-9-p2.patch b/media-sound/xmms2/files/xmms2-0.8-libav-9-p2.patch
1559 deleted file mode 100644
1560 index db55bc8a693..00000000000
1561 --- a/media-sound/xmms2/files/xmms2-0.8-libav-9-p2.patch
1562 +++ /dev/null
1563 @@ -1,50 +0,0 @@
1564 -commit 4781c507be338fe151e08af7d13267a24cbd7572
1565 -Author: Juho Vähä-Herttua <juhovh@×××.fi>
1566 -Date: Fri Jun 8 09:47:03 2012 +0300
1567 -
1568 - OTHER: Fix some deprecated warnings in libavcodec
1569 -
1570 -diff --git a/src/plugins/avcodec/avcodec.c b/src/plugins/avcodec/avcodec.c
1571 -index 242e333..c846d64 100644
1572 ---- a/src/plugins/avcodec/avcodec.c
1573 -+++ b/src/plugins/avcodec/avcodec.c
1574 -@@ -208,7 +208,7 @@ xmms_avcodec_init (xmms_xform_t *xform)
1575 - }
1576 - }
1577 -
1578 -- data->codecctx = avcodec_alloc_context ();
1579 -+ data->codecctx = avcodec_alloc_context3 (codec);
1580 - data->codecctx->sample_rate = data->samplerate;
1581 - data->codecctx->channels = data->channels;
1582 - data->codecctx->bit_rate = data->bitrate;
1583 -@@ -219,7 +219,7 @@ xmms_avcodec_init (xmms_xform_t *xform)
1584 - data->codecctx->codec_id = codec->id;
1585 - data->codecctx->codec_type = codec->type;
1586 -
1587 -- if (avcodec_open (data->codecctx, codec) < 0) {
1588 -+ if (avcodec_open2 (data->codecctx, codec, NULL) < 0) {
1589 - XMMS_DBG ("Opening decoder '%s' failed", codec->name);
1590 - goto err;
1591 - } else {
1592 -diff --git a/src/plugins/avcodec/avcodec_compat.h b/src/plugins/avcodec/avcodec_compat.h
1593 -index f1b1af7..bc770f2 100644
1594 ---- a/src/plugins/avcodec/avcodec_compat.h
1595 -+++ b/src/plugins/avcodec/avcodec_compat.h
1596 -@@ -69,3 +69,17 @@ typedef struct AVPacket {
1597 - #if LIBAVCODEC_VERSION_INT >= 0x350400
1598 - # define avcodec_init()
1599 - #endif
1600 -+
1601 -+/* Map avcodec_alloc_context3 into the deprecated version
1602 -+ * avcodec_alloc_context in versions earlier than 53.04 (ffmpeg 0.9) */
1603 -+#if LIBAVCODEC_VERSION_INT < 0x350400
1604 -+# define avcodec_alloc_context3(codec) \
1605 -+ avcodec_alloc_context()
1606 -+#endif
1607 -+
1608 -+/* Map avcodec_open2 into the deprecated version
1609 -+ * avcodec_open in versions earlier than 53.04 (ffmpeg 0.9) */
1610 -+#if LIBAVCODEC_VERSION_INT < 0x350400
1611 -+# define avcodec_open2(avctx, codec, options) \
1612 -+ avcodec_open(avctx, codec)
1613 -+#endif
1614
1615 diff --git a/media-sound/xmms2/files/xmms2-0.8-libav-9.patch b/media-sound/xmms2/files/xmms2-0.8-libav-9.patch
1616 deleted file mode 100644
1617 index 9c13ec41e02..00000000000
1618 --- a/media-sound/xmms2/files/xmms2-0.8-libav-9.patch
1619 +++ /dev/null
1620 @@ -1,20 +0,0 @@
1621 -commit d61dbc522f4024debb1f99de758de9e5cc7c0936
1622 -Author: Diego Biurrun <diego@×××××××.de>
1623 -Date: Sun Nov 25 17:33:02 2012 +0100
1624 -
1625 - OTHER: Support for newer libavcodec versions
1626 -
1627 - Add missing #include
1628 -
1629 -diff --git a/src/plugins/avcodec/avcodec.c b/src/plugins/avcodec/avcodec.c
1630 -index c846d64..114d7df 100644
1631 ---- a/src/plugins/avcodec/avcodec.c
1632 -+++ b/src/plugins/avcodec/avcodec.c
1633 -@@ -23,6 +23,7 @@
1634 - #include <stdlib.h>
1635 - #include <string.h>
1636 - #include <glib.h>
1637 -+#include <libavutil/mem.h>
1638 -
1639 - #include "avcodec_compat.h"
1640 -
1641
1642 diff --git a/media-sound/xmms2/files/xmms2-0.8-memset.patch b/media-sound/xmms2/files/xmms2-0.8-memset.patch
1643 deleted file mode 100644
1644 index 6f8377d9f92..00000000000
1645 --- a/media-sound/xmms2/files/xmms2-0.8-memset.patch
1646 +++ /dev/null
1647 @@ -1,19 +0,0 @@
1648 -commit 00f4736bbb8ebc88a08e24e98d384b43d5afbbe4
1649 -Author: Raphaël Bois <virtualdust@×××××.com>
1650 -Date: Sun Feb 12 16:39:46 2012 +0100
1651 -
1652 - OTHER: fix erroneous sizeof usage
1653 -
1654 -diff --git a/src/plugins/daap/daap_md5.c b/src/plugins/daap/daap_md5.c
1655 -index d4d8d74..69c84a5 100644
1656 ---- a/src/plugins/daap/daap_md5.c
1657 -+++ b/src/plugins/daap/daap_md5.c
1658 -@@ -191,7 +191,7 @@ OpenDaap_MD5Final (MD5_CTX *ctx,
1659 - MD5Transform (ctx->buf, (guint32 *) ctx->in, ctx->version);
1660 - byteReverse ((unsigned char *) ctx->buf, 4);
1661 - memcpy (digest, ctx->buf, 16);
1662 -- memset (ctx, 0, sizeof (ctx)); /* In case it's sensitive */
1663 -+ memset (ctx, 0, sizeof (*ctx)); /* In case it's sensitive */
1664 -
1665 - return;
1666 - }
1667
1668 diff --git a/media-sound/xmms2/files/xmms2-0.8-modpug.patch b/media-sound/xmms2/files/xmms2-0.8-modpug.patch
1669 deleted file mode 100644
1670 index ce401279c14..00000000000
1671 --- a/media-sound/xmms2/files/xmms2-0.8-modpug.patch
1672 +++ /dev/null
1673 @@ -1,11 +0,0 @@
1674 ---- a/src/plugins/modplug/modplug.c 2011-10-20 20:26:08.000000000 +0000
1675 -+++ b/src/plugins/modplug/modplug.c 2015-01-08 19:52:43.889787624 +0000
1676 -@@ -9,7 +9,7 @@
1677 - #include "xmms/xmms_sample.h"
1678 - #include "xmms/xmms_medialib.h"
1679 - #include "xmms/xmms_log.h"
1680 --#include <modplug.h>
1681 -+#include <libmodplug/modplug.h>
1682 -
1683 - #include <glib.h>
1684 - #include <string.h>
1685
1686 diff --git a/media-sound/xmms2/files/xmms2-0.8-samba-4.patch b/media-sound/xmms2/files/xmms2-0.8-samba-4.patch
1687 deleted file mode 100644
1688 index 937f3d75bea..00000000000
1689 --- a/media-sound/xmms2/files/xmms2-0.8-samba-4.patch
1690 +++ /dev/null
1691 @@ -1,30 +0,0 @@
1692 -commit 86ea5e2d2ac2d8c8c1aee484e8c264440fafcb6a
1693 -Author: Daniel P. Chokola <dan.chokola@×××××.com>
1694 -Date: Wed Jan 1 14:57:35 2014 -0500
1695 -
1696 - BUG(2573): Samba 4.0 uses pkg-config. Find libsmbclient.h properly.
1697 -
1698 -diff --git a/src/plugins/samba/wscript b/src/plugins/samba/wscript
1699 -index 8398169..77d7cda 100644
1700 ---- a/src/plugins/samba/wscript
1701 -+++ b/src/plugins/samba/wscript
1702 -@@ -1,8 +1,17 @@
1703 - from waftools.plugin import plugin
1704 -+from waflib import Errors
1705 -
1706 - def plugin_configure(conf):
1707 -- conf.check_cc(header_name="libsmbclient.h")
1708 -- conf.check(lib="smbclient", uselib_store="smbclient")
1709 -+ try:
1710 -+ conf.check_cfg(package="smbclient", uselib_store="smbclient",
1711 -+ args="--cflags --libs")
1712 -+ except Errors.ConfigurationError:
1713 -+ conf.check_cc(header_name="libsmbclient.h",
1714 -+ uselib="smbclient",
1715 -+ type="cshlib")
1716 -+ conf.check(lib="smbclient", uselib_store="smbclient",
1717 -+ uselib="smbclient",
1718 -+ type="cshlib")
1719 -
1720 - configure, build = plugin("samba", configure=plugin_configure,
1721 - libs=["smbclient"])