Commit 5ff9aeaf authored by Natanael Copa's avatar Natanael Copa

community/vlc: build with ffmpeg 3 and fix build with gcc6

parent 2ebf5830
......@@ -5,7 +5,7 @@ pkgname=vlc
pkgver=2.2.4
_pkgver=${pkgver/_/-}
_ver=${_pkgver%[a-z]}
pkgrel=4
pkgrel=5
pkgdesc="A multi-platform MPEG, VCD/DVD, and DivX player"
triggers="vlc-libs.trigger=/usr/lib/vlc/plugins"
pkgusers="vlc"
......@@ -54,7 +54,7 @@ makedepends="
libtool
dbus-dev
faad2-dev
ffmpeg2.8-dev
ffmpeg-dev
flac-dev
freetype-dev
fribidi-dev
......@@ -105,6 +105,8 @@ makedepends="
samba-dev
"
source="http://download.videolan.org/pub/videolan/$pkgname/${_ver}/$pkgname-$_pkgver.tar.xz
vlc-2.2.4-gcc6_fixes-1.patch
vlc-2.2.4-ffmpeg3-1.patch
fix-waitpid-usage.patch
omxil-rpi-codecs.patch
vlc-libs.trigger"
......@@ -113,14 +115,15 @@ builddir="$srcdir"/$pkgname-$_ver
prepare() {
cd "$builddir"
default_prepare
sed -i -e "/^libxscreensaver_plugin_la_SOURCES/s/^/#/" \
modules/misc/Modules.am || return 1
./bootstrap || return 1
NOCONFIGURE=1 ./bootstrap || return 1
}
build() {
local _arch_opts=
export CXXFLAGS="$CXXFLAGS -std=gnu++98"
export CXXFLAGS="$CXXFLAGS -std=gnu++11"
cd "$builddir"
sed -e 's:/usr/share/fonts/truetype/freefont/FreeSerifBold.ttf:/usr/share/fonts/TTF/DejaVuSerif-Bold.ttf:' \
-i modules/text_renderer/freetype.c
......@@ -323,15 +326,9 @@ plugins_video_filter() { _mv_plugins video_filter; }
plugins_video_output() { _mv_plugins video_output; }
plugins_visualization() { _mv_plugins visualization; }
md5sums="55666c9898f658c7fcca12725bf7dd1b vlc-2.2.4.tar.xz
b28925fdf3d1b0bd13e3af89668995a4 fix-waitpid-usage.patch
b90177830fe33b93849915752eb957ce omxil-rpi-codecs.patch
dd899a9926ad84db9446d92890a5aa3e vlc-libs.trigger"
sha256sums="1632e91d2a0087e0ef4c3fb4c95c3c2890f7715a9d1d43ffd46329f428cf53be vlc-2.2.4.tar.xz
4f017a932d4177ba838ebd7bb0e36d8606103e62519805adff81e5edbda41026 fix-waitpid-usage.patch
27e8f960ca091216b491980a6ffd4e35b28f2091677231ba1d317fc81b6ee039 omxil-rpi-codecs.patch
1c93af2feb217a06f6adc3cd51def8f00eea431f9d26ace7b90c377f7e85fc7a vlc-libs.trigger"
sha512sums="2fc1fe957ba7903f2e0c9640884ed850cb10a60132d80658dee8da0b5abaf4a6ccdf95fa2b8c0a4a827be5e7e40341318bce44662a5248e04442f4779010f85c vlc-2.2.4.tar.xz
0dffb15a320899060d2239d4bbefd7e88bedcd017348227092ed943b1104e971a5da934f0c1569773230186d4727be83f530cc0d253559a04d1f2cdef80e6043 vlc-2.2.4-gcc6_fixes-1.patch
3ac37f5d552b3f4a536ead974756ea39142bb1aebbb5fa4fd41917e3dabb5af333dea5ae028bdae8589ff3016f2d1d87ea328e63d8b795ac90c3eb11945ea87b vlc-2.2.4-ffmpeg3-1.patch
680cfa3eed5501ba6f06c51eae508204f4c77d2bdd07eead1a3da3939b433abfe84025d133e7a1c7a869e4ffac374bd5eba2bd3dd242ec4645e1d1c6122d0ffb fix-waitpid-usage.patch
e13e398b7bfd977f6e099bcb6cf8dc5cd5bad6dea3eff715881826246dc4329468846084aff2576de2b7fd28d3f06e7c327a6e4511a28d22e5cd198a81146c89 omxil-rpi-codecs.patch
b67b6e21e9d4027aef1006e6057f9ba8e65ce3895b08f7b911b1675cff9bc423f64ee2c187c584860e9e5d4635a30408a7781add9694d9bba753eac37f357406 vlc-libs.trigger"
Fixed by @Vaelatern to modify configure.am instead of configure,
and to use -p0 instead of -p1
http://www.linuxfromscratch.org/patches/blfs/svn/vlc-2.2.4-ffmpeg3-1.patch
Submitted By: Armin K <krejzi au email do com>
Date: 2016-05-06
Initial Package Version: 2.2.3
Upstream Status: Committed
Origin: Upstream
Description: Fixes building against ffmpeg3
Rediffed for version 2.2.3 by Bruce Dubbs
diff -Naur configure configure
--- a/configure.ac 2016-09-21 17:28:06.168721882 -0400
+++ b/configure.ac 2016-09-21 17:30:16.529223098 -0400
@@ -2323,8 +2323,8 @@
[ --enable-avcodec libavcodec codec (default enabled)])
AS_IF([test "${enable_avcodec}" != "no"], [
PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 53.34.0 libavutil >= 51.22.0], [
- PKG_CHECK_EXISTS([libavutil < 55],, [
- AC_MSG_ERROR([libavutil versions 55 and later are not supported.])
+ PKG_CHECK_EXISTS([libavutil > 55],, [
+ AC_MSG_ERROR([libavutil versions 55 and before are not supported.])
])
VLC_SAVE_FLAGS
CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
@@ -2382,8 +2382,8 @@
AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
case "${avfork}" in
ffmpeg)
- PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
- AC_MSG_ERROR([VA API requires FFmpeg libavcodec < 57.10 or libav.])
+ PKG_CHECK_EXISTS([libavcodec <= 57.10.100], [
+ AC_MSG_ERROR([VA API requires FFmpeg libavcodec > 57.10 or libav.])
])
;;
esac
@@ -2416,8 +2416,8 @@
AS_IF([test "x${have_avcodec}" = "xyes"], [
case "${avfork}" in
ffmpeg)
- PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
- AC_MSG_ERROR([DXVA2 requires FFmpeg libavcodec < 57.10 or libav.])
+ PKG_CHECK_EXISTS([libavcodec <= 57.10.100], [
+ AC_MSG_ERROR([DXVA2 requires FFmpeg libavcodec > 57.10 or libav.])
])
;;
esac
@@ -3180,7 +3180,7 @@
case "${avfork}" in
libav) av_vdpau_ver="55.26.0" ;;
ffmpeg) av_vdpau_ver="55.42.100"
- PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
+ PKG_CHECK_EXISTS([libavcodec <= 57.10.100], [
AC_MSG_ERROR([VDPAU requires FFmpeg libavcodec < 57.10 or libav.])
])
;;
--- a/modules/codec/avcodec/audio.c 2015-12-08 10:18:56.000000000 -0600
+++ b/modules/codec/avcodec/audio.c 2016-05-06 22:39:24.859030920 -0500
@@ -36,12 +36,11 @@
#include <vlc_codec.h>
#include <vlc_avcodec.h>
+#include "avcodec.h"
+
#include <libavcodec/avcodec.h>
#include <libavutil/mem.h>
-#include <libavutil/audioconvert.h>
-
-#include "avcodec.h"
/*****************************************************************************
* decoder_sys_t : decoder descriptor
diff -Naur modules/codec/avcodec/avcommon_compat.h modules/codec/avcodec/avcommon_compat.h
--- a/modules/codec/avcodec/avcommon_compat.h 2015-03-01 08:07:35.000000000 -0600
+++ b/modules/codec/avcodec/avcommon_compat.h 2016-05-06 22:39:24.859030920 -0500
@@ -506,6 +506,15 @@
#endif /* HAVE_LIBAVUTIL_AVUTIL_H */
+#if LIBAVUTIL_VERSION_MAJOR >= 55
+# define FF_API_AUDIOCONVERT 1
+#endif
+
+/* libavutil/pixfmt.h */
+#ifndef PixelFormat
+# define PixelFormat AVPixelFormat
+#endif
+
#ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
# include <libavformat/avformat.h>
diff -Naur modules/codec/avcodec/encoder.c modules/codec/avcodec/encoder.c
--- a/modules/codec/avcodec/encoder.c 2015-10-21 11:36:45.000000000 -0500
+++ b/modules/codec/avcodec/encoder.c 2016-05-06 22:39:24.860030887 -0500
@@ -41,7 +41,6 @@
#include <vlc_cpu.h>
#include <libavcodec/avcodec.h>
-#include <libavutil/audioconvert.h>
#include "avcodec.h"
#include "avcommon.h"
@@ -311,7 +310,7 @@
else if( !GetFfmpegCodec( p_enc->fmt_out.i_codec, &i_cat, &i_codec_id,
&psz_namecodec ) )
{
- if( FindFfmpegChroma( p_enc->fmt_out.i_codec ) == PIX_FMT_NONE )
+ if( FindFfmpegChroma( p_enc->fmt_out.i_codec ) == AV_PIX_FMT_NONE )
return VLC_EGENERIC; /* handed chroma output */
i_cat = VIDEO_ES;
@@ -1017,7 +1016,7 @@
}
}
- p_sys->frame = avcodec_alloc_frame();
+ p_sys->frame = av_frame_alloc();
if( !p_sys->frame )
{
goto error;
@@ -1088,7 +1087,8 @@
AVFrame *frame = NULL;
if( likely(p_pict) ) {
frame = p_sys->frame;
- avcodec_get_frame_defaults( frame );
+ av_frame_unref( frame );
+
for( i_plane = 0; i_plane < p_pict->i_planes; i_plane++ )
{
p_sys->frame->data[i_plane] = p_pict->p[i_plane].p_pixels;
@@ -1329,7 +1329,7 @@
//How much we need to copy from new packet
const int leftover = leftover_samples * p_sys->p_context->channels * p_sys->i_sample_bytes;
- avcodec_get_frame_defaults( p_sys->frame );
+ av_frame_unref( p_sys->frame );
p_sys->frame->format = p_sys->p_context->sample_fmt;
p_sys->frame->nb_samples = leftover_samples + p_sys->i_samples_delay;
@@ -1451,7 +1451,8 @@
while( ( p_aout_buf->i_nb_samples >= p_sys->i_frame_size ) ||
( p_sys->b_variable && p_aout_buf->i_nb_samples ) )
{
- avcodec_get_frame_defaults( p_sys->frame );
+ av_frame_unref( p_sys->frame );
+
if( p_sys->b_variable )
p_sys->frame->nb_samples = p_aout_buf->i_nb_samples;
else
diff -Naur modules/codec/avcodec/vaapi.c modules/codec/avcodec/vaapi.c
--- a/modules/codec/avcodec/vaapi.c 2014-11-16 12:57:58.000000000 -0600
+++ b/modules/codec/avcodec/vaapi.c 2016-05-06 22:39:24.860030887 -0500
@@ -595,7 +595,7 @@
return err;
/* Only VLD supported */
- p_va->pix_fmt = PIX_FMT_VAAPI_VLD;
+ p_va->pix_fmt = AV_PIX_FMT_VAAPI_VLD;
p_va->setup = Setup;
p_va->get = Get;
p_va->release = Release;
diff -Naur modules/codec/avcodec/video.c modules/codec/avcodec/video.c
--- a/modules/codec/avcodec/video.c 2016-04-04 19:45:24.000000000 -0500
+++ b/modules/codec/avcodec/video.c 2016-05-06 22:39:24.860030887 -0500
@@ -234,7 +234,7 @@
p_sys->p_codec = p_codec;
p_sys->i_codec_id = i_codec_id;
p_sys->psz_namecodec = psz_namecodec;
- p_sys->p_ff_pic = avcodec_alloc_frame();
+ p_sys->p_ff_pic = av_frame_alloc();
p_sys->b_delayed_open = true;
p_sys->p_va = NULL;
vlc_sem_init( &p_sys->sem_mt, 0 );
@@ -446,7 +446,7 @@
if( ffmpeg_OpenCodec( p_dec ) < 0 )
{
msg_Err( p_dec, "cannot open codec (%s)", p_sys->psz_namecodec );
- avcodec_free_frame( &p_sys->p_ff_pic );
+ av_frame_free( &p_sys->p_ff_pic );
vlc_sem_destroy( &p_sys->sem_mt );
free( p_sys );
return VLC_EGENERIC;
@@ -826,7 +826,7 @@
wait_mt( p_sys );
if( p_sys->p_ff_pic )
- avcodec_free_frame( &p_sys->p_ff_pic );
+ av_frame_free( &p_sys->p_ff_pic );
if( p_sys->p_va )
vlc_va_Delete( p_sys->p_va );
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment