summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2013-07-20 15:59:00 +0000
committerAlexis Ballier <aballier@gentoo.org>2013-07-20 15:59:00 +0000
commit815ca65a095d834eb0a362f212ef9ea4620d7aed (patch)
treea70561046250e476b36c26c0b1f8387b18ef2402 /media-video/transcode
parentMarked ~hppa too. (diff)
downloadhistorical-815ca65a095d834eb0a362f212ef9ea4620d7aed.tar.gz
historical-815ca65a095d834eb0a362f212ef9ea4620d7aed.tar.bz2
historical-815ca65a095d834eb0a362f212ef9ea4620d7aed.zip
Do not force using a preset. Fix build with ffmpeg-2.0. Fix segfaults introduced by wrong usage of the av_dict API in the ffmpeg-0.11 patch. Add missing fixes from the libav9 patch.
Package-Manager: portage-2.2.0_alpha188/cvs/Linux x86_64 Manifest-Sign-Key: 0x160F534A
Diffstat (limited to 'media-video/transcode')
-rw-r--r--media-video/transcode/ChangeLog11
-rw-r--r--media-video/transcode/Manifest15
-rw-r--r--media-video/transcode/files/transcode-1.1.7-ffmpeg2.patch332
-rw-r--r--media-video/transcode/files/transcode-1.1.7-preset-force.patch28
-rw-r--r--media-video/transcode/transcode-1.1.7-r3.ebuild120
5 files changed, 504 insertions, 2 deletions
diff --git a/media-video/transcode/ChangeLog b/media-video/transcode/ChangeLog
index bb852c34244e..1f1cbcbdaf27 100644
--- a/media-video/transcode/ChangeLog
+++ b/media-video/transcode/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for media-video/transcode
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/transcode/ChangeLog,v 1.313 2013/05/27 09:09:58 thev00d00 Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-video/transcode/ChangeLog,v 1.314 2013/07/20 15:58:52 aballier Exp $
+
+*transcode-1.1.7-r3 (20 Jul 2013)
+
+ 20 Jul 2013; Alexis Ballier <aballier@gentoo.org> +transcode-1.1.7-r3.ebuild,
+ +files/transcode-1.1.7-ffmpeg2.patch,
+ +files/transcode-1.1.7-preset-force.patch:
+ Do not force using a preset. Fix build with ffmpeg-2.0. Fix segfaults
+ introduced by wrong usage of the av_dict API in the ffmpeg-0.11 patch. Add
+ missing fixes from the libav9 patch.
*transcode-1.1.7-r2 (27 May 2013)
diff --git a/media-video/transcode/Manifest b/media-video/transcode/Manifest
index c4c040ba85d3..6028b349ef70 100644
--- a/media-video/transcode/Manifest
+++ b/media-video/transcode/Manifest
@@ -1,10 +1,23 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
AUX transcode-1.1.7-ffmpeg-0.10.patch 402 SHA256 5df30ce0bdaee1d61a5dd94d242ce010dc043305553519a1532c33b2628ec308 SHA512 d15a222ac21ba91758cdd8c7e43188cfa5fb015d3bdf2c74290b26e5fc12a5899f6a6ac59a9763ee8009ed7fb8fcf4b3dc9ec4f4cc5ca8049bd5f437e7b725bf WHIRLPOOL fc06332d4f2037083f57edfbcd71515fd6d9d64a03bceb3a71ab7d44b795c01eb6cfa8675a27bbe252fa12650dbca5b7100b04f78df3f5515f3827bf59fe88fa
AUX transcode-1.1.7-ffmpeg-0.11.patch 12718 SHA256 52f62257ad3abcaf72b306549f66b3aee2a38d2b84713b42be26b7fdcd5f203d SHA512 9b39f15d20830fb57f86750a54a5a7c6025ad69733d668df45a06fd1134e0a6ee76a495a883797b41870b156b4b8895a4dcedbd5e28712d69a98baa7b5934663 WHIRLPOOL 11905b35e3b4b24e8e779945d81743520c554c0c8653d466db095d0d02510c2f6a00ce8d632f8993d829607d37ec8887e79401f6da230f1e8352bad7e55b0fe1
AUX transcode-1.1.7-ffmpeg.patch 2274 SHA256 443776bbc3497e1f256eb74c19bcda293cfd751776817bafc1ca89ff510e3b61 SHA512 d238b645b27bb83e2a1753b9dc99909084292579b757831d560f9535f1eb4a4892bd89047f0b23625f66e72fe8d373002abf8a6a03334c720b065af4220f5a9a WHIRLPOOL edbec136aa7a53a8119f42c9a2f8f000a743e9045892f160dfa4e513137c9e10c16c0316894874bfeb9026f5f10345fb9b920ff1e5111eedec84f85ae9f680ae
+AUX transcode-1.1.7-ffmpeg2.patch 14318 SHA256 7c07b03d11e1ca0fd377637b8d42d439a8e9350523d6f25adad095b6c01afc0d SHA512 82be56ebbff431514fa86819f00cd9ac8dbdeeab3d7549ca775ace7da5f08c957548afdf996e8781d73fae7b4b9412f8b3b940ce5c261ab599cfa3fd0d2b0d82 WHIRLPOOL 0dac8df2d1ca1a3072e3c8763d433c8c2be7ff436de7d19a2b760493b8ecd9d6f74026f696e933f7533285420dd59f833a1457e2784c7f66a167a4da45d8763e
AUX transcode-1.1.7-libav-9.patch 1413 SHA256 9a53c93b1efa1a6ee6fbe30acbcce4416024d8aa857771d258ddb444f30b48ce SHA512 0868e1b8f440ef8d9314851e02211edc77c3c410b2ec9e860b74cb159d0ea7a77590a933e6ad29b4df5bf8b8ea78f13dae8aa79f361c5437a89b1ba02c7b6e36 WHIRLPOOL 38557b8c2c286bb5a3982c02c229c319114aa6914eb20745127a83a3eb679c7d4d5c989e3661343bba68ad56717842f05da2ea2269ed53e764b708b736b7af29
+AUX transcode-1.1.7-preset-force.patch 1199 SHA256 fe95e83093761924ba0fa5b3214e169812f7740c6c3c434845b1b563d4a37241 SHA512 b2406841674b0d021b1a116e3ef1d16a7206db0930d10d98f3a86923040fbe306296acbac1e14020557c0e9b7e9b28bd0de1f9e1ce20c7fb2c190d15adc6decc WHIRLPOOL e7742ba9dd8a9355f64d640d1005f8713dde5d0ec896583792e73ef0143087d0bbd09673df97c7b65bfe637dbc9ddd2afa1c9786725061440de93b94f7500781
AUX transcode-1.1.7-preset-free.patch 1370 SHA256 2219fe618be2b2c3fbd6e3545cdbd8db8d1c268a0b37bfe867514f871d7d91ef SHA512 46514728ea0970bf69ef0341ea64dae495a1a571a0416cf20cfaa7c922ded0ae8dcfd717c720c53e457a16585722973266e5cc0b509034ed2549338dc9bac912 WHIRLPOOL d7247d7e506bc5fd2ed579d934ceb121a54c93683de143b7c4ffbdd4b33799acc9c1b4e93e90db4788c84bc4320be05ae90d2760a86a979ae1f57fd4e3bf3750
DIST transcode-1.1.7.tar.bz2 2183627 SHA256 1e4e72d8e0dd62a80b8dd90699f5ca64c9b0cb37a5c9325c184166a9654f0a92 SHA512 d6f9674f3f5c3346194120585741ca660eb9ee133085cfce9460a14eaa0cf16fdf291761bd1db78e1c784e4d69a9481c7470cf8357dc7638ee3017620500f45f WHIRLPOOL ccd085b3a2638de92c2d589ff93038fed3d1a760d3513fde2946a805f7efed87813850f5e9eee306ed8efd3608ad9492d16f4c41bd6278379995deb22f92354e
EBUILD transcode-1.1.7-r1.ebuild 3221 SHA256 75d087776934d71ac99943146093ee545d19f34dd02972827357cca05a8340ae SHA512 6fe01dc17791fa70e3bb633b0551e0ee9ba49e3beae83830963a7327e34776a5d84fb9e4b2403f3442a4babe014d620075a065aa0dcd172725ef96ff22fd5970 WHIRLPOOL de1b0f7f395dc6c73d0cf92651de19b530844aabba551c6c307d4056192b9f1265cfdc00acd5a2f6b6e9e6ef42a2c26247b6111cd3c4fa12de8a979d056f957c
EBUILD transcode-1.1.7-r2.ebuild 3269 SHA256 b94a8ba8adcc84f982f7d718f7ee3b2cc4e5686f76dfa40c43fb6057715e05c8 SHA512 708b4e7d28dc2ec0697cf74e628054b4c71408dee61f21890345f94da50274fa8f368f04babb25485f4c408d54fade312bc74fdd52fae287386a76543fe29cb3 WHIRLPOOL e4d28ddf51e0d8df8341309504ad07244b1096a3031a97acb26134099192e1bbfb24aab058ed43fd3ca6e59a7fc4dd883210c5a07b876d32ba4ce99542061893
-MISC ChangeLog 51719 SHA256 60e6662f1d9ad1007474d3e399809994817669ce525f112e9e5fe635947152b0 SHA512 e9655201483873660b772d9488eb6d6dd6684bddaa403fb73d7d83cfd8a9bb62f65aa4996dfb172784161c5ce1b3d1905c19d485c8f05757e32bb3c14c69bd7d WHIRLPOOL 47d6c9e5a57470183708869dead7a079a538052026de571e479a1aa4b3a63a68bccf47c78b80f25f26fa7040d5e4ea7bb13f6cfd43b8848ad6390b9bd8bbd824
+EBUILD transcode-1.1.7-r3.ebuild 3347 SHA256 c2ced641a9a75a05d8c2c601b889a1d0ebdc3328cde4a26ee337561dd7e35024 SHA512 766441c670e3061bd6120d906982b978534bfcdf8a5a84022d72ba95fc2ebff3228d4ee74e2ea87fc923b052315a93465ebd6a20e6698092d4283f1ef50dd267 WHIRLPOOL a4b1efbbc8fff290e5311b0710405f3303571d173a72ab2a460e1d519cd3f4a6faa310836c94a397220575c4a14403d4db62da0987c5409ee91ac0a45e4823b4
+MISC ChangeLog 52107 SHA256 bbbc7ab7a544e5528c37acd2621ad3ca9d7870fa62ef567014ee366f753c057e SHA512 fc1faba48a285a5847d69fb006ea7f7137609adfcc72bf43702e0080e4b884883dedfc2b72118f24b9fe072565ee80aadd8e813672f7423132be08a1cb759b02 WHIRLPOOL d3d42c32b859a600a96b9371563f00b04696297125250f5ea497ed4487c790dacaa4d930cf26db9f24ea5221723f760ad6390a8411c519c14d791318df74277d
MISC metadata.xml 529 SHA256 58d8afd76de3ea91e1967cd96c24957e2ca06226222b81226e6b6ac55ce5f209 SHA512 6c5a6dd9ef9407f0c05f42cdfeaf4d3c2e2e6a4c91028331b6dd905acf1174e7bb937b780d12043f030a6afd344aef0df1a2a3d13cbda5a71724bd1f7a8b8302 WHIRLPOOL c27354b3de6c7cb67a30adac4c66e4b72726ecf3e1a1b05fa2e759ce174cfc51154dcfeb0c1b48754702e304fc95753c42ac626b0d6338021737b84bdb074385
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.20 (GNU/Linux)
+
+iEYEAREIAAYFAlHqs74ACgkQvFcC4BYPU0qr+ACcCiyaJX9Zi+PhjUUqp3vormGe
+39kAn0CSaAxh8kWwHXfolc5xQ1HREj/9
+=0QLq
+-----END PGP SIGNATURE-----
diff --git a/media-video/transcode/files/transcode-1.1.7-ffmpeg2.patch b/media-video/transcode/files/transcode-1.1.7-ffmpeg2.patch
new file mode 100644
index 000000000000..26d7431402d8
--- /dev/null
+++ b/media-video/transcode/files/transcode-1.1.7-ffmpeg2.patch
@@ -0,0 +1,332 @@
+Fix build with ffmpeg-2.0.
+Fix segfaults introduced by wrong usage of the av_dict API.
+Fix forgotten parts in the libav9 patch.
+
+Index: transcode-1.1.7/encode/encode_lavc.c
+===================================================================
+--- transcode-1.1.7.orig/encode/encode_lavc.c
++++ transcode-1.1.7/encode/encode_lavc.c
+@@ -74,6 +74,9 @@ struct tclavcconfigdata_ {
+ int lmin;
+ int lmax;
+ int me_method;
++ int luma_elim_threshold;
++ int chroma_elim_threshold;
++ int quantizer_noise_shaping;
+
+ /* same as above for flags */
+ struct {
+@@ -114,7 +117,7 @@ struct tclavcprivatedata_ {
+
+ AVFrame ff_venc_frame;
+ AVCodecContext ff_vcontext;
+- AVDictionary ** ff_opts;
++ AVDictionary * ff_opts;
+
+ AVCodec *ff_vcodec;
+
+@@ -165,6 +168,7 @@ static const TCCodecID tc_lavc_codecs_ou
+ TC_CODEC_ERROR
+ };
+
++#if LIBAVCODEC_VERSION_MAJOR < 55
+ static const enum CodecID tc_lavc_internal_codecs[] = {
+ CODEC_ID_MPEG1VIDEO, CODEC_ID_MPEG2VIDEO, CODEC_ID_MPEG4,
+ CODEC_ID_H263I, CODEC_ID_H263P,
+@@ -177,6 +181,20 @@ static const enum CodecID tc_lavc_intern
+ CODEC_ID_MSMPEG4V2, CODEC_ID_MSMPEG4V3,
+ CODEC_ID_NONE
+ };
++#else
++static const enum AVCodecID tc_lavc_internal_codecs[] = {
++ AV_CODEC_ID_MPEG1VIDEO, AV_CODEC_ID_MPEG2VIDEO, AV_CODEC_ID_MPEG4,
++ AV_CODEC_ID_H263I, AV_CODEC_ID_H263P,
++ AV_CODEC_ID_H264,
++ AV_CODEC_ID_WMV1, AV_CODEC_ID_WMV2,
++ AV_CODEC_ID_RV10,
++ AV_CODEC_ID_HUFFYUV, AV_CODEC_ID_FFV1,
++ AV_CODEC_ID_DVVIDEO,
++ AV_CODEC_ID_MJPEG, AV_CODEC_ID_LJPEG,
++ AV_CODEC_ID_MSMPEG4V2, AV_CODEC_ID_MSMPEG4V3,
++ AV_CODEC_ID_NONE
++};
++#endif
+
+ static const TCFormatID tc_lavc_formats[] = { TC_FORMAT_ERROR };
+
+@@ -938,7 +956,11 @@ static int tc_lavc_settings_from_vob(TCL
+ static void tc_lavc_config_defaults(TCLavcPrivateData *pd)
+ {
+ /* first of all reinitialize lavc data */
++#if LIBAVCODEC_VERSION_MAJOR < 55
+ avcodec_get_context_defaults(&pd->ff_vcontext);
++#else
++ avcodec_get_context_defaults3(&pd->ff_vcontext, NULL);
++#endif
+
+ pd->confdata.thread_count = 1;
+
+@@ -976,8 +998,8 @@ static void tc_lavc_config_defaults(TCLa
+ pd->ff_vcontext.mpeg_quant = 0;
+ pd->ff_vcontext.rc_initial_cplx = 0.0;
+ pd->ff_vcontext.rc_qsquish = 1.0;
+- pd->ff_vcontext.luma_elim_threshold = 0;
+- pd->ff_vcontext.chroma_elim_threshold = 0;
++ pd->confdata.luma_elim_threshold = 0;
++ pd->confdata.chroma_elim_threshold = 0;
+ pd->ff_vcontext.strict_std_compliance = 0;
+ pd->ff_vcontext.dct_algo = FF_DCT_AUTO;
+ pd->ff_vcontext.idct_algo = FF_IDCT_AUTO;
+@@ -1001,7 +1023,7 @@ static void tc_lavc_config_defaults(TCLa
+ pd->ff_vcontext.intra_quant_bias = FF_DEFAULT_QUANT_BIAS;
+ pd->ff_vcontext.inter_quant_bias = FF_DEFAULT_QUANT_BIAS;
+ pd->ff_vcontext.noise_reduction = 0;
+- pd->ff_vcontext.quantizer_noise_shaping = 0;
++ pd->confdata.quantizer_noise_shaping = 0;
+ pd->ff_vcontext.flags = 0;
+ }
+
+@@ -1033,7 +1055,6 @@ static void tc_lavc_dispatch_settings(TC
+
+ pd->ff_vcontext.flags = 0;
+ SET_FLAG(pd, mv0);
+- SET_FLAG(pd, cbp);
+ SET_FLAG(pd, qpel);
+ SET_FLAG(pd, naq);
+ SET_FLAG(pd, ilme);
+@@ -1060,17 +1081,29 @@ static void tc_lavc_dispatch_settings(TC
+ pd->ff_vcontext.flags |= CODEC_FLAG_INTERLACED_ME;
+ }
+ if (pd->confdata.flags.alt) {
+- av_dict_set(pd->ff_opts, "alternate_scan", "1", 0);
++ av_dict_set(&(pd->ff_opts), "alternate_scan", "1", 0);
+ }
+ if (pd->confdata.flags.vdpart) {
+- av_dict_set(pd->ff_opts, "data_partitioning", "1", 0);
++ av_dict_set(&(pd->ff_opts), "data_partitioning", "1", 0);
+ }
+ if (pd->confdata.flags.umv) {
+- av_dict_set(pd->ff_opts, "umv", "1", 0);
++ av_dict_set(&(pd->ff_opts), "umv", "1", 0);
+ }
+ if (pd->confdata.flags.aiv) {
+- av_dict_set(pd->ff_opts, "aiv", "1", 0);
++ av_dict_set(&(pd->ff_opts), "aiv", "1", 0);
+ }
++ if (pd->confdata.flags.cbp) {
++ av_dict_set(&(pd->ff_opts), "mpv_flags", "+cbp_rd", 0);
++ }
++
++ char buf[1024];
++#define set_dict_opt(val, opt) \
++ snprintf(buf, sizeof(buf), "%i", pd->confdata.val);\
++ av_dict_set(&(pd->ff_opts), opt, buf, 0)
++
++ set_dict_opt(luma_elim_threshold, "luma_elim_threshold");
++ set_dict_opt(chroma_elim_threshold, "chroma_elim_threshold");
++ set_dict_opt(quantizer_noise_shaping, "quantizer_noise_shaping");
+ }
+
+ #undef SET_FLAG
+@@ -1155,8 +1188,8 @@ static int tc_lavc_read_config(TCLavcPri
+ { "vrc_init_cplx", PCTX(rc_initial_cplx), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 9999999.0 },
+ // { "vrc_init_occupancy", }, // not yet supported
+ { "vqsquish", PCTX(rc_qsquish), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 99.0 },
+- { "vlelim", PCTX(luma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
+- { "vcelim", PCTX(chroma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
++ { "vlelim", PAUX(luma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
++ { "vcelim", PAUX(chroma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
+ { "vstrict", PCTX(strict_std_compliance), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
+ { "vpsize", PCTX(rtp_payload_size), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100000000 },
+ { "dct", PCTX(dct_algo), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10 },
+@@ -1182,12 +1215,12 @@ static int tc_lavc_read_config(TCLavcPri
+ { "ibias", PCTX(intra_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 },
+ { "pbias", PCTX(inter_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 },
+ { "nr", PCTX(noise_reduction), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000000},
+- { "qns", PCTX(quantizer_noise_shaping), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 3 },
++ { "qns", PAUX(quantizer_noise_shaping), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 3 },
+ { "inter_matrix_file", inter_matrix_file, TCCONF_TYPE_STRING, 0, 0, 0 },
+ { "intra_matrix_file", intra_matrix_file, TCCONF_TYPE_STRING, 0, 0, 0 },
+
+ { "mv0", PAUX(flags.mv0), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_MV0 },
+- { "cbp", PAUX(flags.cbp), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CBP_RD },
++ { "cbp", PAUX(flags.cbp), TCCONF_TYPE_FLAG, 0, 0, 1 },
+ { "qpel", PAUX(flags.qpel), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QPEL },
+ { "alt", PAUX(flags.alt), TCCONF_TYPE_FLAG, 0, 0, 1 },
+ { "ilme", PAUX(flags.ilme), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME },
+@@ -1350,6 +1383,8 @@ static int tc_lavc_configure(TCModuleIns
+
+ pd = self->userdata;
+
++ pd->ff_opts = NULL;
++
+ pd->flush_flag = vob->encoder_flush;
+
+ /* FIXME: move into core? */
+@@ -1402,7 +1437,7 @@ static int tc_lavc_configure(TCModuleIns
+ }
+
+ TC_LOCK_LIBAVCODEC;
+- ret = avcodec_open2(&pd->ff_vcontext, pd->ff_vcodec, pd->ff_opts);
++ ret = avcodec_open2(&pd->ff_vcontext, pd->ff_vcodec, &(pd->ff_opts));
+ TC_UNLOCK_LIBAVCODEC;
+
+ if (ret < 0) {
+Index: transcode-1.1.7/export/export_ffmpeg.c
+===================================================================
+--- transcode-1.1.7.orig/export/export_ffmpeg.c
++++ transcode-1.1.7/export/export_ffmpeg.c
+@@ -122,7 +122,7 @@ static uint8_t *img_buffer =
+ static AVFrame *lavc_convert_frame = NULL;
+
+ static AVCodec *lavc_venc_codec = NULL;
+-static AVDictionary **lavc_venc_opts = NULL;
++static AVDictionary *lavc_venc_opts = NULL;
+ static AVFrame *lavc_venc_frame = NULL;
+ static AVCodecContext *lavc_venc_context;
+ static avi_t *avifile = NULL;
+@@ -486,7 +486,7 @@ MOD_init
+ codec->name, codec->fourCC, codec->comments);
+ }
+
+- lavc_venc_context = avcodec_alloc_context();
++ lavc_venc_context = avcodec_alloc_context3(lavc_venc_codec);
+ lavc_venc_frame = avcodec_alloc_frame();
+
+ lavc_convert_frame= avcodec_alloc_frame();
+@@ -838,8 +838,13 @@ MOD_init
+ lavc_venc_context->rc_strategy = lavc_param_vrc_strategy;
+ lavc_venc_context->b_frame_strategy = lavc_param_vb_strategy;
+ lavc_venc_context->b_quant_offset = lavc_param_vb_qoffset;
+- lavc_venc_context->luma_elim_threshold= lavc_param_luma_elim_threshold;
+- lavc_venc_context->chroma_elim_threshold= lavc_param_chroma_elim_threshold;
++
++ char buf[1024];
++#define set_dict_opt(val, opt) \
++ snprintf(buf, sizeof(buf), "%i", val); \
++ av_dict_set(&lavc_venc_opts, opt, buf, 0)
++ set_dict_opt(lavc_param_luma_elim_threshold, "luma_elim_threshold");
++ set_dict_opt(lavc_param_chroma_elim_threshold, "chroma_elim_threshold");
+ lavc_venc_context->rtp_payload_size = lavc_param_packet_size;
+ #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
+ if (lavc_param_packet_size)
+@@ -870,7 +875,7 @@ MOD_init
+ lavc_venc_context->context_model = lavc_param_context;
+ lavc_venc_context->scenechange_threshold= lavc_param_sc_threshold;
+ lavc_venc_context->noise_reduction = lavc_param_noise_reduction;
+- lavc_venc_context->inter_threshold = lavc_param_inter_threshold;
++ set_dict_opt(lavc_param_inter_threshold, "inter_threshold");
+ lavc_venc_context->intra_dc_precision = lavc_param_intra_dc_precision;
+ lavc_venc_context->skip_top = lavc_param_skip_top;
+ lavc_venc_context->skip_bottom = lavc_param_skip_bottom;
+@@ -1066,9 +1071,11 @@ MOD_init
+ lavc_venc_context->flags |= lavc_param_trunc;
+ lavc_venc_context->flags |= lavc_param_aic;
+ lavc_venc_context->flags |= lavc_param_v4mv;
+- lavc_venc_context->flags |= lavc_param_cbp;
++ if(lavc_param_cbp)
++ av_dict_set(&lavc_venc_opts, "mpv_flags", "+cbp_rd", 0);
+ lavc_venc_context->flags |= lavc_param_mv0;
+- lavc_venc_context->flags |= lavc_param_qp_rd;
++ if(lavc_param_qp_rd)
++ av_dict_set(&lavc_venc_opts, "mpv_flags", "+qp_rd", 0);
+ lavc_venc_context->flags |= lavc_param_ilme;
+ #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
+ lavc_venc_context->flags |= lavc_param_trell;
+@@ -1238,29 +1245,29 @@ MOD_init
+ }
+
+ if (lavc_param_scan_offset) {
+- av_dict_set(lavc_venc_opts, "scan_offset", "1", 0);
++ av_dict_set(&lavc_venc_opts, "scan_offset", "1", 0);
+ }
+
+ if (lavc_param_ss) {
+- av_dict_set(lavc_venc_opts, "structured_slices", "1", 0);
++ av_dict_set(&lavc_venc_opts, "structured_slices", "1", 0);
+ }
+
+ if (lavc_param_alt) {
+- av_dict_set(lavc_venc_opts, "alternate_scan", "1", 0);
++ av_dict_set(&lavc_venc_opts, "alternate_scan", "1", 0);
+ }
+
+ if (lavc_param_umv) {
+- av_dict_set(lavc_venc_opts, "umv", "1", 0);
++ av_dict_set(&lavc_venc_opts, "umv", "1", 0);
+ }
+
+ if (lavc_param_data_partitioning) {
+- av_dict_set(lavc_venc_opts, "vdpart", "1", 0);
++ av_dict_set(&lavc_venc_opts, "vdpart", "1", 0);
+ }
+
+ //-- open codec --
+ //----------------
+ TC_LOCK_LIBAVCODEC;
+- ret = avcodec_open2(lavc_venc_context, lavc_venc_codec, lavc_venc_opts);
++ ret = avcodec_open2(lavc_venc_context, lavc_venc_codec, &lavc_venc_opts);
+ TC_UNLOCK_LIBAVCODEC;
+ if (ret < 0) {
+ tc_log_warn(MOD_NAME, "could not open FFMPEG codec");
+Index: transcode-1.1.7/export/ffmpeg_cfg.c
+===================================================================
+--- transcode-1.1.7.orig/export/ffmpeg_cfg.c
++++ transcode-1.1.7/export/ffmpeg_cfg.c
+@@ -214,10 +214,10 @@ TCConfigEntry lavcopts_conf[]={
+ {"context", &lavc_param_context, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10},
+ {"intra_matrix", &lavc_param_intra_matrix, TCCONF_TYPE_STRING, 0, 0, 0},
+ {"inter_matrix", &lavc_param_inter_matrix, TCCONF_TYPE_STRING, 0, 0, 0},
+- {"cbp", &lavc_param_cbp, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CBP_RD},
++ {"cbp", &lavc_param_cbp, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"mv0", &lavc_param_mv0, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_MV0},
+ {"nr", &lavc_param_noise_reduction, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000000},
+- {"qprd", &lavc_param_qp_rd, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QP_RD},
++ {"qprd", &lavc_param_qp_rd, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"threads", &lavc_param_threads, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 16},
+ {"ss", &lavc_param_ss, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"svcd_sof", &lavc_param_scan_offset, TCCONF_TYPE_FLAG, 0, 0, 1},
+Index: transcode-1.1.7/export/aud_aux.c
+===================================================================
+--- transcode-1.1.7.orig/export/aud_aux.c
++++ transcode-1.1.7/export/aud_aux.c
+@@ -346,7 +346,7 @@ static int tc_audio_init_ffmpeg(vob_t *v
+
+ //-- set parameters (bitrate, channels and sample-rate) --
+ //--------------------------------------------------------
+- avcodec_get_context_defaults(&mpa_ctx);
++ avcodec_get_context_defaults3(&mpa_ctx, mpa_codec);
+ #if LIBAVCODEC_VERSION_MAJOR < 53
+ mpa_ctx.codec_type = CODEC_TYPE_AUDIO;
+ #else
+@@ -359,7 +359,7 @@ static int tc_audio_init_ffmpeg(vob_t *v
+ //-- open codec --
+ //----------------
+ TC_LOCK_LIBAVCODEC;
+- ret = avcodec_open(&mpa_ctx, mpa_codec);
++ ret = avcodec_open2(&mpa_ctx, mpa_codec, NULL);
+ TC_UNLOCK_LIBAVCODEC;
+ if (ret < 0) {
+ tc_warn("tc_audio_init_ffmpeg: could not open %s codec !",
+Index: transcode-1.1.7/import/import_ffmpeg.c
+===================================================================
+--- transcode-1.1.7.orig/import/import_ffmpeg.c
++++ transcode-1.1.7/import/import_ffmpeg.c
+@@ -302,7 +302,7 @@ do_avi:
+
+ // Set these to the expected values so that ffmpeg's decoder can
+ // properly detect interlaced input.
+- lavc_dec_context = avcodec_alloc_context();
++ lavc_dec_context = avcodec_alloc_context3(lavc_dec_codec);
+ if (lavc_dec_context == NULL) {
+ tc_log_error(MOD_NAME, "Could not allocate enough memory.");
+ return TC_IMPORT_ERROR;
+@@ -344,7 +344,7 @@ do_avi:
+ }
+
+ TC_LOCK_LIBAVCODEC;
+- ret = avcodec_open(lavc_dec_context, lavc_dec_codec);
++ ret = avcodec_open2(lavc_dec_context, lavc_dec_codec, NULL);
+ TC_UNLOCK_LIBAVCODEC;
+ if (ret < 0) {
+ tc_log_warn(MOD_NAME, "Could not initialize the '%s' codec.",
diff --git a/media-video/transcode/files/transcode-1.1.7-preset-force.patch b/media-video/transcode/files/transcode-1.1.7-preset-force.patch
new file mode 100644
index 000000000000..0d1da8b4f666
--- /dev/null
+++ b/media-video/transcode/files/transcode-1.1.7-preset-force.patch
@@ -0,0 +1,28 @@
+Do not force using a preset. Do not try to open non-existant preset by default.
+
+Index: transcode-1.1.7/export/export_ffmpeg.c
+===================================================================
+--- transcode-1.1.7.orig/export/export_ffmpeg.c
++++ transcode-1.1.7/export/export_ffmpeg.c
+@@ -1206,7 +1206,7 @@ MOD_init
+ lavc_venc_context->me_method = ME_ZERO + lavc_param_vme;
+
+ /* FIXME: transcode itself contains "broken ffmpeg default settings", thus we need to override them! */
+- if (lavc_param_video_preset) {
++ if (lavc_param_video_preset && strcmp(lavc_param_video_preset, "none")) {
+ avcodec_opts[AVMEDIA_TYPE_VIDEO] = lavc_venc_context;
+ video_codec_name = av_strdup(ffmpeg_codec_name(codec->name));
+
+Index: transcode-1.1.7/export/ffmpeg_cfg.c
+===================================================================
+--- transcode-1.1.7.orig/export/ffmpeg_cfg.c
++++ transcode-1.1.7/export/ffmpeg_cfg.c
+@@ -124,7 +124,7 @@ int lavc_param_gmc = 0;
+ //int lavc_param_atag = 0;
+ //int lavc_param_abitrate = 224;
+
+-char *lavc_param_video_preset = "medium";
++char *lavc_param_video_preset = "none";
+ char *lavc_param_ffmpeg_datadir = "/usr/share/ffmpeg";
+
+ TCConfigEntry lavcopts_conf[]={
diff --git a/media-video/transcode/transcode-1.1.7-r3.ebuild b/media-video/transcode/transcode-1.1.7-r3.ebuild
new file mode 100644
index 000000000000..8991eec9ba11
--- /dev/null
+++ b/media-video/transcode/transcode-1.1.7-r3.ebuild
@@ -0,0 +1,120 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-video/transcode/transcode-1.1.7-r3.ebuild,v 1.1 2013/07/20 15:58:52 aballier Exp $
+
+EAPI=5
+inherit eutils libtool multilib
+
+DESCRIPTION="A suite of utilities for transcoding video and audio codecs in different containers"
+HOMEPAGE="http://tcforge.berlios.de/"
+SRC_URI="mirror://bitbucket/france/${PN}-tcforge/downloads/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="3dnow a52 aac alsa altivec dv dvd +iconv imagemagick jpeg lzo mjpeg mmx mp3 mpeg nuv ogg oss pic postproc quicktime sdl sse sse2 theora truetype v4l vorbis X x264 xml xvid"
+
+RDEPEND="
+ >=virtual/ffmpeg-0.10
+ a52? ( media-libs/a52dec )
+ aac? ( media-libs/faac )
+ alsa? ( media-libs/alsa-lib )
+ dv? ( media-libs/libdv )
+ dvd? ( media-libs/libdvdread )
+ iconv? ( virtual/libiconv )
+ imagemagick? ( media-gfx/imagemagick )
+ jpeg? ( virtual/jpeg )
+ lzo? ( >=dev-libs/lzo-2 )
+ mjpeg? ( media-video/mjpegtools )
+ mp3? ( media-sound/lame )
+ mpeg? ( media-libs/libmpeg2 )
+ ogg? ( media-libs/libogg )
+ postproc? ( >=virtual/ffmpeg-0.10 )
+ quicktime? ( >=media-libs/libquicktime-1 )
+ sdl? ( >=media-libs/libsdl-1.2.5[X?] )
+ theora? ( media-libs/libtheora )
+ truetype? ( >=media-libs/freetype-2 )
+ v4l? ( media-libs/libv4l )
+ vorbis? ( media-libs/libvorbis )
+ X? ( x11-libs/libXpm x11-libs/libXaw x11-libs/libXv )
+ x264? ( media-libs/x264 )
+ xml? ( dev-libs/libxml2 )
+ xvid? ( media-libs/xvid )
+ "
+
+DEPEND="
+ ${RDEPEND}
+ virtual/pkgconfig
+ v4l? ( >=sys-kernel/linux-headers-2.6.11 )
+ "
+
+REQUIRED_USE="
+ sse? ( mmx )
+ sse2? ( mmx sse )
+ 3dnow? ( mmx )
+ nuv? ( lzo )
+ "
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-ffmpeg.patch \
+ "${FILESDIR}"/${P}-ffmpeg-0.10.patch \
+ "${FILESDIR}"/${P}-ffmpeg-0.11.patch \
+ "${FILESDIR}"/${P}-preset-free.patch \
+ "${FILESDIR}"/${P}-libav-9.patch \
+ "${FILESDIR}"/${P}-preset-force.patch \
+ "${FILESDIR}"/${P}-ffmpeg2.patch
+
+ elibtoolize
+}
+
+src_configure() {
+ local myconf
+ use x86 && myconf="$(use_enable !pic x86-textrels)" #271476
+
+ econf \
+ $(use_enable mmx) \
+ $(use_enable 3dnow) \
+ $(use_enable sse) \
+ $(use_enable sse2) \
+ $(use_enable altivec) \
+ $(use_enable v4l libv4l2) \
+ $(use_enable v4l libv4lconvert) \
+ $(use_enable mpeg libmpeg2) \
+ $(use_enable mpeg libmpeg2convert) \
+ --enable-experimental \
+ --enable-deprecated \
+ $(use_enable v4l) \
+ $(use_enable oss) \
+ $(use_enable alsa) \
+ $(use_enable postproc libpostproc) \
+ $(use_enable truetype freetype2) \
+ $(use_enable mp3 lame) \
+ $(use_enable xvid) \
+ $(use_enable x264) \
+ $(use_enable ogg) \
+ $(use_enable vorbis) \
+ $(use_enable theora) \
+ $(use_enable dvd libdvdread) \
+ $(use_enable dv libdv) \
+ $(use_enable quicktime libquicktime) \
+ $(use_enable lzo) \
+ $(use_enable a52) \
+ $(use_enable aac faac) \
+ $(use_enable xml libxml2) \
+ $(use_enable mjpeg mjpegtools) \
+ $(use_enable sdl) \
+ $(use_enable imagemagick) \
+ $(use_enable jpeg libjpeg) \
+ $(use_enable iconv) \
+ $(use_enable nuv) \
+ $(use_with X x) \
+ --with-mod-path=/usr/$(get_libdir)/transcode \
+ ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" docsdir=/usr/share/doc/${PF} install
+ dodoc AUTHORS ChangeLog README STYLE TODO
+ find "${ED}"usr -name '*.la' -exec rm -f {} +
+}