Gentoo Archives: gentoo-commits

From: Alexis Ballier <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/mplayer/, media-video/mplayer/files/
Date: Sun, 04 Oct 2015 17:32:54
Message-Id: 1443979945.54e44680864197e00ec9dbe8e1d66d346e996dea.aballier@gentoo
1 commit: 54e44680864197e00ec9dbe8e1d66d346e996dea
2 Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 4 17:32:12 2015 +0000
4 Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 4 17:32:25 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=54e44680
7
8 media-video/mplayer: bump to release 1.2
9
10 Package-Manager: portage-2.2.22
11
12 media-video/mplayer/Manifest | 1 +
13 .../mplayer/files/mplayer-1.2-get_buffer.patch | 327 +++++++++++++++++++++
14 .../{mplayer-9999.ebuild => mplayer-1.2.ebuild} | 13 +-
15 media-video/mplayer/mplayer-9999.ebuild | 2 +-
16 4 files changed, 341 insertions(+), 2 deletions(-)
17
18 diff --git a/media-video/mplayer/Manifest b/media-video/mplayer/Manifest
19 index 8aad2a9..bb818f3 100644
20 --- a/media-video/mplayer/Manifest
21 +++ b/media-video/mplayer/Manifest
22 @@ -1,4 +1,5 @@
23 DIST MPlayer-1.1.1.tar.xz 11202492 SHA256 ce8fc7c3179e6a57eb3a58cb7d1604388756b8a61764cc93e095e7aff3798c76 SHA512 06371d47b02caec83c7662f6bb4a827eafb7f3309f6cda959a0f49b647df031166a6e7c5d530b57b580104289ee260aa96f3f43cbfffcef816cea776b0d5aed0 WHIRLPOOL 3cd0f3845cd45961b778c384a322bc628cc9cd6fef3801b62389bd616a443ba5270c378a889412a7dc72d37ff26704d5d989d2c995a2a4a6540f6313ccacbb63
24 +DIST MPlayer-1.2.tar.xz 13019196 SHA256 ffe7f6f10adf2920707e8d6c04f0d3ed34c307efc6cd90ac46593ee8fba2e2b6 SHA512 ac10dd4facd0d8fbc3454a3a2eae0e0d2ed76fa60f30ebd6f8495632e4541af712ab2d005e88bc2baa8302ccb98d63ba80a051db80d2b76ac928a2bd779b47aa WHIRLPOOL 65bcda55684dced6b286e505df4180f849d6a9f2e1e44560f3393311694ea5a0e96cd7c454b8bbc4198b92c1fd3b0fb4f7c5f6842710b40dc47216037a88b33b
25 DIST font-arial-cp1250.tar.bz2 249705 SHA256 423a07e780bb130cd8e4730715545c5d919c248dda595aab7a0a01de3c83fd12 SHA512 4f77ff5ceb8ec6e5d9f8f34d8950a6a6276d1fd5a947772fcbdb6554988b1ea665c12b82f45164f91fb7bd08000cb4afc26fa35beb4c760464160e22b9b8c340 WHIRLPOOL d635f54be65b0ca1047d943b6f6da433cda9fce6ed74fcab993501cf7f6b443eb711e182cd7fff09e553d251b5fd1c60196aa22e8370cba99fa175ed5ecdb47f
26 DIST font-arial-iso-8859-1.tar.bz2 234242 SHA256 9730f481764f367c9089d0166fb6ccf9148808ffbbfeca635cf0e6db75765d29 SHA512 a1d03b6f09c48f48b7733f3bc0402ceab239a9abf88b860d852ea9fe69b4da690208a79d6f29d30204f5b37becf10672e8e8c0bfef201846d80ec54df617d029 WHIRLPOOL 8050362b125d3ca98214526cee2fa685e31487d13a6483c765bfc844bdc5e07beeba2c1ba313458096d43a63edd6c5e80b8b388c2792fc0ec7421e4072d8ca25
27 DIST font-arial-iso-8859-2.tar.bz2 222208 SHA256 71debfc960007c2f6242dfc91e8b1c005b30a99e129aeb00ab8c03f4371b41c1 SHA512 5671e628303fd816f64a51ad10e2f4dd9c3dc1b34c379a2ecf489b83931db7af668aaa4e00e96a00cacd63ed98daeae6b6a4d5925edfb06fc98d3a923f70257d WHIRLPOOL 08178087b4ea1dfb2250f4673785e31dd876b06af51c51b2bddc172b23e6e33cbc1b2c6b710a317e42dc05486974b26ed0ad3ca50a185567aa77d49bd1e72aee
28
29 diff --git a/media-video/mplayer/files/mplayer-1.2-get_buffer.patch b/media-video/mplayer/files/mplayer-1.2-get_buffer.patch
30 new file mode 100644
31 index 0000000..3329b98
32 --- /dev/null
33 +++ b/media-video/mplayer/files/mplayer-1.2-get_buffer.patch
34 @@ -0,0 +1,327 @@
35 +r37476 | rtogni | 2015-09-05 18:20:27 +0200 (Sat, 05 Sep 2015) | 5 lines
36 +
37 +Replace deprecated get_buffer, buffer_hints, and others
38 +
39 +This is needed to compile with latest FFmpeg
40 +
41 +Index: libmpcodecs/vd_ffmpeg.c
42 +===================================================================
43 +--- libmpcodecs/vd_ffmpeg.c (revision 37475)
44 ++++ libmpcodecs/vd_ffmpeg.c (revision 37476)
45 +@@ -40,6 +40,7 @@
46 + #if CONFIG_VDPAU
47 + #include "libavcodec/vdpau.h"
48 + #endif
49 ++#include "libavutil/pixdesc.h"
50 +
51 + static const vd_info_t info = {
52 + "FFmpeg's libavcodec codec family",
53 +@@ -95,8 +96,11 @@
54 +
55 + #include "m_option.h"
56 +
57 +-static int get_buffer(AVCodecContext *avctx, AVFrame *pic);
58 ++static int get_buffer(AVCodecContext *avctx, AVFrame *pic, int isreference);
59 ++static int mpcodec_default_get_buffer(AVCodecContext *avctx, AVFrame *frame);
60 ++static int get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags);
61 + static void release_buffer(AVCodecContext *avctx, AVFrame *pic);
62 ++static void mpcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
63 + static void draw_slice(struct AVCodecContext *s, const AVFrame *src, int offset[4],
64 + int y, int type, int height);
65 +
66 +@@ -269,19 +273,10 @@
67 + if (lavc_param_vismv || (lavc_param_debug & (FF_DEBUG_VIS_MB_TYPE|FF_DEBUG_VIS_QP))) {
68 + ctx->do_slices = ctx->do_dr1 = 0;
69 + }
70 +-#ifndef CODEC_FLAG_EMU_EDGE
71 +-#define CODEC_FLAG_EMU_EDGE 0
72 +-#endif
73 + if(ctx->do_dr1){
74 +- avctx->flags |= CODEC_FLAG_EMU_EDGE;
75 +- avctx-> reget_buffer =
76 +- avctx-> get_buffer = get_buffer;
77 +- avctx->release_buffer = release_buffer;
78 ++ avctx->get_buffer2 = get_buffer2;
79 + } else if (lavc_codec->capabilities & CODEC_CAP_DR1) {
80 +- avctx->flags &= ~CODEC_FLAG_EMU_EDGE;
81 +- avctx-> reget_buffer = avcodec_default_reget_buffer;
82 +- avctx-> get_buffer = avcodec_default_get_buffer;
83 +- avctx->release_buffer = avcodec_default_release_buffer;
84 ++ avctx->get_buffer2 = avcodec_default_get_buffer2;
85 + }
86 + avctx->slice_flags = 0;
87 + }
88 +@@ -309,9 +304,7 @@
89 + if (IMGFMT_IS_HWACCEL(imgfmt)) {
90 + ctx->do_dr1 = 1;
91 + ctx->nonref_dr = 0;
92 +- avctx->get_buffer = get_buffer;
93 +- avctx->release_buffer = release_buffer;
94 +- avctx->reget_buffer = get_buffer;
95 ++ avctx->get_buffer2 = get_buffer2;
96 + mp_msg(MSGT_DECVIDEO, MSGL_V, IMGFMT_IS_XVMC(imgfmt) ?
97 + MSGTR_MPCODECS_XVMCAcceleratedMPEG2 :
98 + "[VD_FFMPEG] VDPAU accelerated decoding\n");
99 +@@ -384,7 +377,6 @@
100 + #endif
101 + avctx->flags2|= lavc_param_fast;
102 + avctx->codec_tag= sh->format;
103 +- avctx->stream_codec_tag= sh->video.fccHandler;
104 + avctx->idct_algo= lavc_param_idct_algo;
105 + avctx->error_concealment= lavc_param_error_concealment;
106 + avctx->debug= lavc_param_debug;
107 +@@ -668,7 +660,7 @@
108 + return 0;
109 + }
110 +
111 +-static int get_buffer(AVCodecContext *avctx, AVFrame *pic){
112 ++static int get_buffer(AVCodecContext *avctx, AVFrame *pic, int isreference){
113 + sh_video_t *sh = avctx->opaque;
114 + vd_ffmpeg_ctx *ctx = sh->context;
115 + mp_image_t *mpi=NULL;
116 +@@ -677,27 +669,12 @@
117 + int width = FFMAX(avctx->width, -(-avctx->coded_width >> avctx->lowres));
118 + int height= FFMAX(avctx->height, -(-avctx->coded_height >> avctx->lowres));
119 + // special case to handle reget_buffer
120 +- if (pic->opaque && pic->data[0] && (!pic->buffer_hints || pic->buffer_hints & FF_BUFFER_HINTS_REUSABLE))
121 ++ if (pic->opaque && pic->data[0])
122 + return 0;
123 + avcodec_align_dimensions(avctx, &width, &height);
124 + //printf("get_buffer %d %d %d\n", pic->reference, ctx->ip_count, ctx->b_count);
125 +
126 +- if (pic->buffer_hints) {
127 +- mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "Buffer hints: %u\n", pic->buffer_hints);
128 +- type = MP_IMGTYPE_TEMP;
129 +- if (pic->buffer_hints & FF_BUFFER_HINTS_READABLE)
130 +- flags |= MP_IMGFLAG_READABLE;
131 +- if (pic->buffer_hints & FF_BUFFER_HINTS_PRESERVE ||
132 +- pic->buffer_hints & FF_BUFFER_HINTS_REUSABLE) {
133 +- ctx->ip_count++;
134 +- type = MP_IMGTYPE_IP;
135 +- flags |= MP_IMGFLAG_PRESERVE;
136 +- }
137 +- flags|=(avctx->skip_idct<=AVDISCARD_DEFAULT && avctx->skip_frame<=AVDISCARD_DEFAULT && ctx->do_slices) ?
138 +- MP_IMGFLAG_DRAW_CALLBACK:0;
139 +- mp_msg(MSGT_DECVIDEO, MSGL_DBG2, type == MP_IMGTYPE_IP ? "using IP\n" : "using TEMP\n");
140 +- } else {
141 +- if(!pic->reference){
142 ++ if(!isreference){
143 + ctx->b_count++;
144 + flags|=(avctx->skip_idct<=AVDISCARD_DEFAULT && avctx->skip_frame<=AVDISCARD_DEFAULT && ctx->do_slices) ?
145 + MP_IMGFLAG_DRAW_CALLBACK:0;
146 +@@ -711,11 +688,10 @@
147 + }else{
148 + type= MP_IMGTYPE_IP;
149 + }
150 +- }
151 +
152 + if (ctx->nonref_dr) {
153 + if (flags & MP_IMGFLAG_PRESERVE)
154 +- return avcodec_default_get_buffer(avctx, pic);
155 ++ return mpcodec_default_get_buffer(avctx, pic);
156 + // Use NUMBERED since for e.g. TEMP vos assume there will
157 + // be no other frames between the get_image and matching put_image.
158 + type = MP_IMGTYPE_NUMBERED;
159 +@@ -722,7 +698,6 @@
160 + }
161 +
162 + if(init_vo(sh, avctx->pix_fmt, 1) < 0){
163 +- avctx->release_buffer= avcodec_default_release_buffer;
164 + goto disable_dr1;
165 + }
166 +
167 +@@ -822,7 +797,6 @@
168 + else
169 + printf(".");
170 + #endif
171 +- pic->type= FF_BUFFER_TYPE_USER;
172 + return 0;
173 +
174 + disable_dr1:
175 +@@ -829,13 +803,11 @@
176 + ctx->do_dr1 = 0;
177 + // For frame-multithreading these contexts aren't
178 + // the same and must both be updated.
179 +- ctx->avctx->get_buffer =
180 +- avctx->get_buffer = avcodec_default_get_buffer;
181 +- ctx->avctx->reget_buffer =
182 +- avctx->reget_buffer = avcodec_default_reget_buffer;
183 ++ ctx->avctx->get_buffer2 =
184 ++ avctx->get_buffer2 = avcodec_default_get_buffer2;
185 + if (pic->data[0])
186 +- release_buffer(avctx, pic);
187 +- return avctx->get_buffer(avctx, pic);
188 ++ mpcodec_default_release_buffer(avctx, pic);
189 ++ return avctx->get_buffer2(avctx, pic,0);
190 + }
191 +
192 + static void release_buffer(struct AVCodecContext *avctx, AVFrame *pic){
193 +@@ -843,8 +815,8 @@
194 + sh_video_t *sh = avctx->opaque;
195 + vd_ffmpeg_ctx *ctx = sh->context;
196 + int i;
197 +- if (pic->type != FF_BUFFER_TYPE_USER) {
198 +- avcodec_default_release_buffer(avctx, pic);
199 ++ if (pic->opaque == NULL) {
200 ++ mpcodec_default_release_buffer(avctx, pic);
201 + return;
202 + }
203 +
204 +@@ -954,7 +926,7 @@
205 + // even when we do dr we might actually get a buffer we had
206 + // FFmpeg allocate - this mostly happens with nonref_dr.
207 + // Ensure we treat it correctly.
208 +- dr1= ctx->do_dr1 && pic->type == FF_BUFFER_TYPE_USER;
209 ++ dr1= ctx->do_dr1 && pic->opaque != NULL;
210 + if(ret<0) mp_msg(MSGT_DECVIDEO, MSGL_WARN, "Error while decoding frame!\n");
211 + //printf("repeat: %d\n", pic->repeat_pict);
212 + //-- vstats generation
213 +@@ -1128,3 +1100,148 @@
214 + set_format_params(avctx, selected_format);
215 + return selected_format;
216 + }
217 ++
218 ++
219 ++/*
220 ++ FFWrapper
221 ++*/
222 ++static int mpcodec_default_get_buffer(AVCodecContext *avctx, AVFrame *frame)
223 ++{
224 ++ return avcodec_default_get_buffer2(avctx, frame, 0);
225 ++}
226 ++
227 ++static void mpcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic)
228 ++{
229 ++ av_frame_unref(pic);
230 ++}
231 ++
232 ++typedef struct CompatReleaseBufPriv {
233 ++ AVCodecContext avctx;
234 ++ AVFrame frame;
235 ++ uint8_t avframe_padding[1024]; // hack to allow linking to a avutil with larger AVFrame
236 ++} CompatReleaseBufPriv;
237 ++
238 ++static void compat_free_buffer(void *opaque, uint8_t *data)
239 ++{
240 ++ CompatReleaseBufPriv *priv = opaque;
241 ++ release_buffer(&priv->avctx, &priv->frame);
242 ++ av_freep(&priv);
243 ++}
244 ++
245 ++static void compat_release_buffer(void *opaque, uint8_t *data)
246 ++{
247 ++ AVBufferRef *buf = opaque;
248 ++ av_buffer_unref(&buf);
249 ++}
250 ++
251 ++static int get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags)
252 ++{
253 ++ /*
254 ++ * Wrap an old get_buffer()-allocated buffer in a bunch of AVBuffers.
255 ++ * We wrap each plane in its own AVBuffer. Each of those has a reference to
256 ++ * a dummy AVBuffer as its private data, unreffing it on free.
257 ++ * When all the planes are freed, the dummy buffer's free callback calls
258 ++ * release_buffer().
259 ++ */
260 ++ CompatReleaseBufPriv *priv = NULL;
261 ++ AVBufferRef *dummy_buf = NULL;
262 ++ int planes, i, ret;
263 ++
264 ++ ret = get_buffer(avctx, frame, flags & AV_GET_BUFFER_FLAG_REF);
265 ++ if (ret < 0)
266 ++ return ret;
267 ++
268 ++ /* return if the buffers are already set up
269 ++ * this would happen e.g. when a custom get_buffer() calls
270 ++ * avcodec_default_get_buffer
271 ++ */
272 ++ if (frame->buf[0])
273 ++ goto end0;
274 ++
275 ++ priv = av_mallocz(sizeof(*priv));
276 ++ if (!priv) {
277 ++ ret = AVERROR(ENOMEM);
278 ++ goto fail;
279 ++ }
280 ++ priv->avctx = *avctx;
281 ++ priv->frame = *frame;
282 ++
283 ++ dummy_buf = av_buffer_create(NULL, 0, compat_free_buffer, priv, 0);
284 ++ if (!dummy_buf) {
285 ++ ret = AVERROR(ENOMEM);
286 ++ goto fail;
287 ++ }
288 ++
289 ++#define WRAP_PLANE(ref_out, data, data_size) \
290 ++do { \
291 ++ AVBufferRef *dummy_ref = av_buffer_ref(dummy_buf); \
292 ++ if (!dummy_ref) { \
293 ++ ret = AVERROR(ENOMEM); \
294 ++ goto fail; \
295 ++ } \
296 ++ ref_out = av_buffer_create(data, data_size, compat_release_buffer, \
297 ++ dummy_ref, 0); \
298 ++ if (!ref_out) { \
299 ++ av_buffer_unref(&dummy_ref); \
300 ++ av_frame_unref(frame); \
301 ++ ret = AVERROR(ENOMEM); \
302 ++ goto fail; \
303 ++ } \
304 ++} while (0)
305 ++
306 ++ if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
307 ++ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
308 ++
309 ++ planes = av_pix_fmt_count_planes(frame->format);
310 ++ /* workaround for AVHWAccel plane count of 0, buf[0] is used as
311 ++ check for allocated buffers: make libavcodec happy */
312 ++ if (desc && desc->flags & AV_PIX_FMT_FLAG_HWACCEL)
313 ++ planes = 1;
314 ++ if (!desc || planes <= 0) {
315 ++ ret = AVERROR(EINVAL);
316 ++ goto fail;
317 ++ }
318 ++
319 ++ for (i = 0; i < planes; i++) {
320 ++ int v_shift = (i == 1 || i == 2) ? desc->log2_chroma_h : 0;
321 ++ int plane_size = (frame->height >> v_shift) * frame->linesize[i];
322 ++
323 ++ WRAP_PLANE(frame->buf[i], frame->data[i], plane_size);
324 ++ }
325 ++ } else {
326 ++ int planar = av_sample_fmt_is_planar(frame->format);
327 ++ planes = planar ? avctx->channels : 1;
328 ++
329 ++ if (planes > FF_ARRAY_ELEMS(frame->buf)) {
330 ++ frame->nb_extended_buf = planes - FF_ARRAY_ELEMS(frame->buf);
331 ++ frame->extended_buf = av_malloc_array(sizeof(*frame->extended_buf),
332 ++ frame->nb_extended_buf);
333 ++ if (!frame->extended_buf) {
334 ++ ret = AVERROR(ENOMEM);
335 ++ goto fail;
336 ++ }
337 ++ }
338 ++
339 ++ for (i = 0; i < FFMIN(planes, FF_ARRAY_ELEMS(frame->buf)); i++)
340 ++ WRAP_PLANE(frame->buf[i], frame->extended_data[i], frame->linesize[0]);
341 ++
342 ++ for (i = 0; i < frame->nb_extended_buf; i++)
343 ++ WRAP_PLANE(frame->extended_buf[i],
344 ++ frame->extended_data[i + FF_ARRAY_ELEMS(frame->buf)],
345 ++ frame->linesize[0]);
346 ++ }
347 ++
348 ++ av_buffer_unref(&dummy_buf);
349 ++
350 ++end0:
351 ++ frame->width = avctx->width;
352 ++ frame->height = avctx->height;
353 ++
354 ++ return 0;
355 ++
356 ++fail:
357 ++ release_buffer(avctx, frame);
358 ++ av_freep(&priv);
359 ++ av_buffer_unref(&dummy_buf);
360 ++ return ret;
361 ++}
362
363 diff --git a/media-video/mplayer/mplayer-9999.ebuild b/media-video/mplayer/mplayer-1.2.ebuild
364 similarity index 96%
365 copy from media-video/mplayer/mplayer-9999.ebuild
366 copy to media-video/mplayer/mplayer-1.2.ebuild
367 index af049c6..3289e6b 100644
368 --- a/media-video/mplayer/mplayer-9999.ebuild
369 +++ b/media-video/mplayer/mplayer-1.2.ebuild
370 @@ -159,7 +159,7 @@ RDEPEND+="
371 SLOT="0"
372 LICENSE="GPL-2"
373 if [[ ${PV} != *9999* ]]; then
374 - KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
375 + KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
376 else
377 KEYWORDS=""
378 fi
379 @@ -188,6 +188,11 @@ REQUIRED_USE="
380 xvmc? ( xv )"
381 RESTRICT="faac? ( bindist )"
382
383 +PATCHES=(
384 + # Work with pulseaudio-6, bug #549680, https://trac.mplayerhq.hu/ticket/2241
385 + "${FILESDIR}"/${PN}-1.2_pre20150214-pulseaudio-6.0.patch
386 +)
387 +
388 pkg_setup() {
389 if [[ ${PV} == *9999* ]]; then
390 elog
391 @@ -260,6 +265,12 @@ src_prepare() {
392
393 # Use sane default for >=virtual/udev-197
394 sed -i -e '/default_dvd_device/s:/dev/dvd:/dev/cdrom:' configure || die
395 +
396 + if has_version '>=media-video/ffmpeg-2.9'; then
397 + epatch "${FILESDIR}/${PN}-1.2_pre20150730-chan.patch"
398 + epatch "${FILESDIR}/${PN}-1.2-get_buffer.patch"
399 + epatch "${FILESDIR}/${PN}-1.2_pre20150730-encode.patch"
400 + fi
401 }
402
403 src_configure() {
404
405 diff --git a/media-video/mplayer/mplayer-9999.ebuild b/media-video/mplayer/mplayer-9999.ebuild
406 index af049c6..04b762c 100644
407 --- a/media-video/mplayer/mplayer-9999.ebuild
408 +++ b/media-video/mplayer/mplayer-9999.ebuild
409 @@ -60,7 +60,7 @@ RDEPEND+="
410 sys-libs/ncurses:0=
411 app-arch/bzip2
412 sys-libs/zlib
413 - >=media-video/ffmpeg-2.6:0=[vdpau?]
414 + >=media-video/ffmpeg-2.8:0=[vdpau?]
415 a52? ( media-libs/a52dec )
416 aalib? ( media-libs/aalib )
417 alsa? ( media-libs/alsa-lib )