[packages/vcmi] - fix building with ffmpeg 3 - rel 3

baggins baggins at pld-linux.org
Tue Mar 29 02:42:31 CEST 2016


commit 9219c4a0a1631c416eff4828f21a21a35bb3dc49
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Tue Mar 29 02:42:07 2016 +0200

    - fix building with ffmpeg 3
    - rel 3

 ffmpeg3.patch | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 vcmi.spec     |  4 +++-
 2 files changed, 55 insertions(+), 1 deletion(-)
---
diff --git a/vcmi.spec b/vcmi.spec
index c527fc7..5f8640b 100644
--- a/vcmi.spec
+++ b/vcmi.spec
@@ -1,7 +1,7 @@
 Summary:	Heroes 3: WoG recreated
 Name:		vcmi
 Version:	0.98
-Release:	2
+Release:	3
 License:	GPL v2+
 Group:		X11/Applications/Games
 Source0:	https://github.com/vcmi/vcmi/archive/%{version}/%{name}-%{version}.tar.gz
@@ -9,6 +9,7 @@ Source0:	https://github.com/vcmi/vcmi/archive/%{version}/%{name}-%{version}.tar.
 Source1:	http://download.vcmi.eu/core.zip
 # Source1-md5:	5cf75d588cc53b93aceb809a6068ae37
 Patch0:		boost-1.58.patch
+Patch1:		ffmpeg3.patch
 URL:		http://www.vcmi.eu/
 BuildRequires:	Qt5Network-devel
 BuildRequires:	qt5-build
@@ -36,6 +37,7 @@ H3 engine rewrie (not another mod) with new possibilities.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 install -d build
diff --git a/ffmpeg3.patch b/ffmpeg3.patch
new file mode 100644
index 0000000..919d31e
--- /dev/null
+++ b/ffmpeg3.patch
@@ -0,0 +1,52 @@
+diff -ur vcmi-0.98.orig/client/CVideoHandler.cpp vcmi-0.98/client/CVideoHandler.cpp
+--- vcmi-0.98.orig/client/CVideoHandler.cpp	2015-04-01 09:34:22.000000000 +0200
++++ vcmi-0.98/client/CVideoHandler.cpp	2016-03-29 01:45:43.689696331 +0200
+@@ -155,7 +155,7 @@
+ 	}
+ 
+ 	// Allocate video frame
+-	frame = avcodec_alloc_frame();
++	frame = av_frame_alloc();
+ 	
+ 	//setup scaling
+ 	
+@@ -201,21 +201,21 @@
+ #endif
+ 	{ // Convert the image into YUV format that SDL uses
+ 		sws = sws_getContext(codecContext->width, codecContext->height, codecContext->pix_fmt, 
+-							 pos.w, pos.h, PIX_FMT_YUV420P, 
++							 pos.w, pos.h, AV_PIX_FMT_YUV420P, 
+ 							 SWS_BICUBIC, nullptr, nullptr, nullptr);
+ 	}
+ 	else
+ 	{
+ 
+-		PixelFormat screenFormat = PIX_FMT_NONE;
++		AVPixelFormat screenFormat = AV_PIX_FMT_NONE;
+ 		if (screen->format->Bshift > screen->format->Rshift)
+ 		{
+ 			// this a BGR surface
+ 			switch (screen->format->BytesPerPixel)
+ 			{
+-				case 2: screenFormat = PIX_FMT_BGR565; break;
+-				case 3: screenFormat = PIX_FMT_BGR24; break;
+-				case 4: screenFormat = PIX_FMT_BGR32; break;
++				case 2: screenFormat = AV_PIX_FMT_BGR565; break;
++				case 3: screenFormat = AV_PIX_FMT_BGR24; break;
++				case 4: screenFormat = AV_PIX_FMT_BGR32; break;
+ 				default: return false;
+ 			}
+ 		}
+@@ -224,9 +224,9 @@
+ 			// this a RGB surface
+ 			switch (screen->format->BytesPerPixel)
+ 			{
+-				case 2: screenFormat = PIX_FMT_RGB565; break;
+-				case 3: screenFormat = PIX_FMT_RGB24; break;
+-				case 4: screenFormat = PIX_FMT_RGB32; break;
++				case 2: screenFormat = AV_PIX_FMT_RGB565; break;
++				case 3: screenFormat = AV_PIX_FMT_RGB24; break;
++				case 4: screenFormat = AV_PIX_FMT_RGB32; break;
+ 				default: return false;
+ 			}
+ 		}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/vcmi.git/commitdiff/9219c4a0a1631c416eff4828f21a21a35bb3dc49



More information about the pld-cvs-commit mailing list