diff options
author | Chí-Thanh Christopher Nguyễn <chithanh@gentoo.org> | 2013-11-23 13:52:41 +0000 |
---|---|---|
committer | Chí-Thanh Christopher Nguyễn <chithanh@gentoo.org> | 2013-11-23 13:52:41 +0000 |
commit | 09cab313eb40f45a8e880eff2f16446a8e9364d8 (patch) | |
tree | 0f06dab63caf06df5ce17b0488ea4a650800b8eb /www-plugins/lightspark | |
parent | Revision bump to propagate the change to the udev rule. (diff) | |
download | historical-09cab313eb40f45a8e880eff2f16446a8e9364d8.tar.gz historical-09cab313eb40f45a8e880eff2f16446a8e9364d8.tar.bz2 historical-09cab313eb40f45a8e880eff2f16446a8e9364d8.zip |
Add ffmpeg-2 support, bug #492336.
Package-Manager: portage-2.2.7/cvs/Linux x86_64
Diffstat (limited to 'www-plugins/lightspark')
-rw-r--r-- | www-plugins/lightspark/ChangeLog | 6 | ||||
-rw-r--r-- | www-plugins/lightspark/Manifest | 5 | ||||
-rw-r--r-- | www-plugins/lightspark/files/lightspark-0.7.2-ffmpeg20.patch | 155 | ||||
-rw-r--r-- | www-plugins/lightspark/lightspark-0.7.2-r1.ebuild | 3 |
4 files changed, 165 insertions, 4 deletions
diff --git a/www-plugins/lightspark/ChangeLog b/www-plugins/lightspark/ChangeLog index c803ad10a7eb..b221af5793e3 100644 --- a/www-plugins/lightspark/ChangeLog +++ b/www-plugins/lightspark/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for www-plugins/lightspark # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/www-plugins/lightspark/ChangeLog,v 1.53 2013/10/04 23:53:41 chithanh Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-plugins/lightspark/ChangeLog,v 1.54 2013/11/23 13:52:37 chithanh Exp $ + + 23 Nov 2013; Chí-Thanh Christopher Nguyễn <chithanh@gentoo.org> + +files/lightspark-0.7.2-ffmpeg20.patch, lightspark-0.7.2-r1.ebuild: + Add ffmpeg-2 support, bug #492336. *lightspark-0.7.2-r1 (04 Oct 2013) diff --git a/www-plugins/lightspark/Manifest b/www-plugins/lightspark/Manifest index 2a473551b661..4ade94093e77 100644 --- a/www-plugins/lightspark/Manifest +++ b/www-plugins/lightspark/Manifest @@ -1,8 +1,9 @@ +AUX lightspark-0.7.2-ffmpeg20.patch 6379 SHA256 fed424330c029f29fdb1e8f45850e080b5d4c1ac32c66509c54287fcd2b3965a SHA512 dc68891c2621be3118ab31313366b32ae48d3ba338c61198476134fe1e1f8d6b4a42daa2c2e843daca8df7597c3a8e27e52dba47274928aa2e75ea7d1fde6858 WHIRLPOOL c28471e0e7b412de452fa79b07f4acf36a1756e874222ccc05ddbc353d7987bb41562b55eba8f07df14773082abc950d6e6e6be947533d47ce84b70ccb86bd82 AUX lightspark-0.7.2-llvm33.patch 3809 SHA256 66ba3a932f477e42c4171e1fc29ef382215fb8e5cba6e8167f8527d5f1bd15b5 SHA512 dee691cbaab2e26e788f2d94fd5731084400862868a7f0e06e6c1b269a0c1f30d3d814ec20f63612f786b4c57569ba0e5f888194f3d1f5ad80ce8e98299c96e3 WHIRLPOOL ffcbc2d59542d6ecd5d62c408ab3846a6367ecf4371007a47be6de6cda889c64673d8b7fad98e310af19d77f9cb2ce79c960eb3c7ad481231eda25ac06bc3d7d DIST lightspark-0.7.1.tar.gz 920218 SHA256 a6f9ef13ddf3ebd700d4daaeeb4e9497889c18697aeca1ddcb30ac8cdc20e931 SHA512 a8c10782f144cf4b9a39d32ca4c78f441957550f790161671fa52fec686672f22ab977b41c55b5e33d1e65eaa28e78bf48e729ce01f51b56ef24d2d09e62eeae WHIRLPOOL 0842b113070cc679d8e960e558bf4d7562f6796f60b923fc4fe41f3e20f4cb86da0340d8f27543d86c2cf6aefaf1232990c9ef51bcdcb765dc89befee16823cc DIST lightspark-0.7.2.tar.gz 955952 SHA256 70479bac90f3455a5ff6d0aaf6bccaedfbaac3c70bd602680f68ce75eab2dd1b SHA512 90442d92b54bef18c20952aefd4dcd5cab446213cf9c186b340c9c8e0dd3ef28d034e888ca26f5b9ffe93d0cfd6e1a3c696fbd6f561aa21ff909d463abd27d29 WHIRLPOOL 9465424e2d8b46adb5aadc54239b6d58105703c519f5073ffbc3eb7a03dacca68cf64d57864de3c0aefd6d7cd4c3a88b0deb8417917980a8b60fa49397dc0631 EBUILD lightspark-0.7.1.ebuild 2953 SHA256 50b71455dbd2da0f42d45a29b9c0cce4e99c98d1336bb10e9bccf31f49fef020 SHA512 530f6a7543e448e3f8f313620a55b48d7d2b33b0856bb412b3a2befabb2ee74f2722fc0e760434e5298e542e2a24f74d2b0bee58a26d28b632699dd510db37fd WHIRLPOOL 9be201b8d02b9a35d44f694a804775d5d0fe265692923941fe40b4767a6f263a43382ecb98d12da5a6017901de3b5a97d9092ed9b99c6ac7f74bf4bff402b6df -EBUILD lightspark-0.7.2-r1.ebuild 2634 SHA256 09e543f4e8ddf2409662d7b3d864318492b2f4859fd98e03503c6161db740e4d SHA512 51e4ba4798650e3dea6e48d906a52a94c4d3cf66a3621d7c5d3c25b6e7e817d964360ae7e49207f0b3ad861c9946c9479eb8a8ca56eccb03f6e1484629d1a48c WHIRLPOOL f64f5087fd40ebd055a376d7e5c60220552890dbd6731329147cfab8de1dc2723c7925705955eeb3167f40315474775ea430805aef43acdb71f90349d62e1160 +EBUILD lightspark-0.7.2-r1.ebuild 2669 SHA256 b83657f8b08e65bb72773b3e9f1fdca200d67860bd95b343c3a5e7719a007e93 SHA512 608747e7d946335032f15fbcf69893698ba8efd40b988a7aaa5f753fa57f03931568f43b3c22e921e3c26483b98cb947188ca804fd7917f7ff7065edd9b5fe5c WHIRLPOOL f6ba867cef7f4a2aa4bf2c5f7c91590e5a7e0169e0c265ab3ff99e4f6ea3296ad516dbee4b4e11d0c2e217231ea2a29ce7b05672e33cd9709c46a326c6a71ca7 EBUILD lightspark-0.7.2.ebuild 2953 SHA256 718e1c24772211ce1958e45c5f0d92dfd159ad8cff0efbd4790107ac1fb328e0 SHA512 c54187908f76e1c5585250ed7ca2844f6b54371b1fe3abcce860e952f4974fbaef5d2cb90154fa0d850ef3340ddcfaca04b1eb18652e884b7365d18319ea6932 WHIRLPOOL 7c44d852576a9be81ab7998e2709b733e8b2199b59db11b49db4d3bf29ba274d14272c0d046456a90edfbee9f5af65238b42d3faa5a79e750cbdd5cda8e678b6 -MISC ChangeLog 12266 SHA256 1ac072b86c53cffcdc77077919364056cb58020b0f3e1b4c75083f333a2b3cc9 SHA512 39fe33713e88fc3782cbffbd9664a04185879c52ef0d6956340fa301e84b6320aa057efe0619a7e212ef95c5f8ea2095ca8cbb162e421086008ceacc602dc82f WHIRLPOOL 4d12ec787085bd0dd2097c9aa8b1268ff6c855623810fe109aa26ecc95959f52fa81f4dd86c310297cec11eb3959f631927d28a655c15125e32203d2e691cdd2 +MISC ChangeLog 12443 SHA256 ee5c44230c79037b820eb058d2fbd15a39be80b704cdca9ee0becc0bfa0cadf8 SHA512 d0982b53383308a8be05dcf62859657f5677d188e91bcb797921e04c0e67533fb41efc48dd1283eed7033d189a36c19bbfeca55efad8187552c87a1107e1f05a WHIRLPOOL 16fb3a08ab968aedd82397f6657e454183e70816703493e8a996d13ae0d040e583972bfa8cef2f1fc9f48218a069d440150f826361bcc8b54dd6f0b13eb8e13b MISC metadata.xml 416 SHA256 1a4739e3ed47fd391141b1df084195435ad9cc1ac50650eb3b45d1fccb2f87e9 SHA512 d5181074005c87614f42ddfe267092a526acfe8f49b5f621141a026d23c3c7471b5254f0edb0b88af8d8689db8effb819fe08663a904b0984ea9bc2917fc394a WHIRLPOOL 0d2788c7f2af963e5038d71cef665a58b9e49095f90dc7b339c0343974fd40142a1005972a16cfb51fd45b42703b1f2ecbd5c59ba74c6bca60bdf54821d6b8c8 diff --git a/www-plugins/lightspark/files/lightspark-0.7.2-ffmpeg20.patch b/www-plugins/lightspark/files/lightspark-0.7.2-ffmpeg20.patch new file mode 100644 index 000000000000..c0a1f5f3610c --- /dev/null +++ b/www-plugins/lightspark/files/lightspark-0.7.2-ffmpeg20.patch @@ -0,0 +1,155 @@ +From fff7e63650c1569908bf80f11a123e051e993f31 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ludger=20Kr=C3=A4mer?= <dbluelle@blau-weissoedingen.de> +Date: Fri, 16 Aug 2013 20:30:28 +0200 +Subject: [PATCH] fix compilation with ffmpeg 2.0 avcodec_decode_audio4 seems + not to deliver data in AV_SAMPLE_FMT_S16 format, so we have to use + libavresample for resampling + +--- + CMakeLists.txt | 2 +- + conf/FindFFMpeg.cmake | 6 ++++- + src/backends/decoder.cpp | 64 ++++++++++++++++++++++++++++++++++++++++++------ + src/backends/decoder.h | 8 ++++++ + 4 files changed, 70 insertions(+), 10 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 33dbb85..d3a964b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -286,7 +286,7 @@ IF(AUDIO_BACKEND) + ENDIF(AUDIO_BACKEND) + + IF(ENABLE_LIBAVCODEC) +- pkg_check_modules(FFMPEG libavcodec libavutil libavformat) ++ pkg_check_modules(FFMPEG libavcodec libavutil libavformat libavresample) + IF(NOT(FFMPEG_FOUND)) + INCLUDE(FindFFMpeg REQUIRED) + ENDIF(NOT(FFMPEG_FOUND)) +diff --git a/conf/FindFFMpeg.cmake b/conf/FindFFMpeg.cmake +index 2b4dd98..8246c15 100644 +--- a/conf/FindFFMpeg.cmake ++++ b/conf/FindFFMpeg.cmake +@@ -23,7 +23,11 @@ FIND_LIBRARY(FFMPEG_AVFORMAT_LIBRARY NAMES + avformat + ) + +-SET(FFMPEG_LIBRARY ${FFMPEG_AVCODEC_LIBRARY} ${FFMPEG_AVUTIL_LIBRARY} ${FFMPEG_AVFORMAT_LIBRARY}) ++FIND_LIBRARY(FFMPEG_AVRESAMPLE_LIBRARY NAMES ++ avresample ++) ++ ++SET(FFMPEG_LIBRARY ${FFMPEG_AVCODEC_LIBRARY} ${FFMPEG_AVUTIL_LIBRARY} ${FFMPEG_AVFORMAT_LIBRARY} ${FFMPEG_AVRESAMPLE_LIBRARY}) + MARK_AS_ADVANCED(FFMPEG_LIBRARY) + + # handle the QUIETLY and REQUIRED arguments and set FFMPEG_FOUND to TRUE if +diff --git a/src/backends/decoder.cpp b/src/backends/decoder.cpp +index 22eac2e..4b3148c 100755 +--- a/src/backends/decoder.cpp ++++ b/src/backends/decoder.cpp +@@ -295,6 +295,8 @@ bool FFMpegVideoDecoder::decodePacket(AVPacket* pkt, uint32_t time) + #else + int ret=avcodec_decode_video(codecContext, frameIn, &frameOk, pkt->data, pkt->size); + #endif ++ if (ret < 0) ++ return false; + + assert_and_throw(ret==(int)pkt->size); + if(frameOk) +@@ -612,10 +614,33 @@ uint32_t FFMpegAudioDecoder::decodeData(uint8_t* data, int32_t datalen, uint32_t + ret=-1; + else + { +- //This is suboptimal but equivalent to what libavcodec +- //does for the compatibility version of avcodec_decode_audio3 +- memcpy(curTail.samples, frameIn->extended_data[0], frameIn->linesize[0]); +- maxLen=frameIn->linesize[0]; ++ if (frameIn->format != AV_SAMPLE_FMT_S16) ++ { ++ AVAudioResampleContext * avr = avresample_alloc_context(); ++ av_opt_set_int(avr, "in_channel_layout", frameIn->channel_layout, 0); ++ av_opt_set_int(avr, "out_channel_layout", frameIn->channel_layout, 0); ++ av_opt_set_int(avr, "in_sample_rate", frameIn->sample_rate, 0); ++ av_opt_set_int(avr, "out_sample_rate", frameIn->sample_rate, 0); ++ av_opt_set_int(avr, "in_sample_fmt", frameIn->format, 0); ++ av_opt_set_int(avr, "out_sample_fmt", AV_SAMPLE_FMT_S16, 0); ++ avresample_open(avr); ++ ++ uint8_t *output; ++ int out_linesize; ++ int out_samples = avresample_available(avr) + av_rescale_rnd(avresample_get_delay(avr) + frameIn->linesize[0], frameIn->sample_rate, frameIn->sample_rate, AV_ROUND_UP); ++ av_samples_alloc(&output, &out_linesize, frameIn->nb_samples, out_samples, AV_SAMPLE_FMT_S16, 0); ++ maxLen = avresample_convert(avr, &output, out_linesize, out_samples, frameIn->extended_data, frameIn->linesize[0], frameIn->nb_samples)*4; ++ memcpy(curTail.samples, output, maxLen); ++ av_freep(&output); ++ avresample_free(&avr); ++ } ++ else ++ { ++ //This is suboptimal but equivalent to what libavcodec ++ //does for the compatibility version of avcodec_decode_audio3 ++ memcpy(curTail.samples, frameIn->extended_data[0], frameIn->linesize[0]); ++ maxLen=frameIn->linesize[0]; ++ } + } + #else + int32_t ret=avcodec_decode_audio3(codecContext, curTail.samples, &maxLen, &pkt); +@@ -660,10 +685,33 @@ uint32_t FFMpegAudioDecoder::decodePacket(AVPacket* pkt, uint32_t time) + ret=-1; + else + { +- //This is suboptimal but equivalent to what libavcodec +- //does for the compatibility version of avcodec_decode_audio3 +- memcpy(curTail.samples, frameIn->extended_data[0], frameIn->linesize[0]); +- maxLen=frameIn->linesize[0]; ++ if (frameIn->format != AV_SAMPLE_FMT_S16) ++ { ++ AVAudioResampleContext * avr = avresample_alloc_context(); ++ av_opt_set_int(avr, "in_channel_layout", frameIn->channel_layout, 0); ++ av_opt_set_int(avr, "out_channel_layout", frameIn->channel_layout, 0); ++ av_opt_set_int(avr, "in_sample_rate", frameIn->sample_rate, 0); ++ av_opt_set_int(avr, "out_sample_rate", frameIn->sample_rate, 0); ++ av_opt_set_int(avr, "in_sample_fmt", frameIn->format, 0); ++ av_opt_set_int(avr, "out_sample_fmt", AV_SAMPLE_FMT_S16, 0); ++ avresample_open(avr); ++ ++ uint8_t *output; ++ int out_linesize; ++ int out_samples = avresample_available(avr) + av_rescale_rnd(avresample_get_delay(avr) + frameIn->linesize[0], frameIn->sample_rate, frameIn->sample_rate, AV_ROUND_UP); ++ av_samples_alloc(&output, &out_linesize, frameIn->nb_samples, out_samples, AV_SAMPLE_FMT_S16, 0); ++ maxLen = avresample_convert(avr, &output, out_linesize, out_samples, frameIn->extended_data, frameIn->linesize[0], frameIn->nb_samples)*4; ++ memcpy(curTail.samples, output, maxLen); ++ av_freep(&output); ++ avresample_free(&avr); ++ } ++ else ++ { ++ //This is suboptimal but equivalent to what libavcodec ++ //does for the compatibility version of avcodec_decode_audio3 ++ memcpy(curTail.samples, frameIn->extended_data[0], frameIn->linesize[0]); ++ maxLen=frameIn->linesize[0]; ++ } + } + #elif HAVE_AVCODEC_DECODE_AUDIO3 + int ret=avcodec_decode_audio3(codecContext, curTail.samples, &maxLen, pkt); +diff --git a/src/backends/decoder.h b/src/backends/decoder.h +index 93950ad..28bd232 100644 +--- a/src/backends/decoder.h ++++ b/src/backends/decoder.h +@@ -28,6 +28,14 @@ + { + #include <libavcodec/avcodec.h> + #include <libavformat/avformat.h> ++#include <libavresample/avresample.h> ++#include <libavutil/opt.h> ++#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE ++#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio ++#endif ++#ifndef CodecID ++#define CodecID AVCodecID ++#endif + #define MAX_AUDIO_FRAME_SIZE AVCODEC_MAX_AUDIO_FRAME_SIZE + } + #else +-- +1.8.4 + diff --git a/www-plugins/lightspark/lightspark-0.7.2-r1.ebuild b/www-plugins/lightspark/lightspark-0.7.2-r1.ebuild index ad693d192ee7..bdd939568dd8 100644 --- a/www-plugins/lightspark/lightspark-0.7.2-r1.ebuild +++ b/www-plugins/lightspark/lightspark-0.7.2-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/www-plugins/lightspark/lightspark-0.7.2-r1.ebuild,v 1.1 2013/10/04 23:53:41 chithanh Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-plugins/lightspark/lightspark-0.7.2-r1.ebuild,v 1.2 2013/11/23 13:52:37 chithanh Exp $ EAPI=4 inherit cmake-utils nsplugins multilib toolchain-funcs @@ -55,6 +55,7 @@ S=${WORKDIR}/${P/_rc*/} PATCHES=( "${FILESDIR}/${P}-llvm33.patch" + "${FILESDIR}/${P}-ffmpeg20.patch" ) pkg_pretend() { if [[ ${MERGE_TYPE} != binary ]]; then |