[packages/fceultra] - added patch for x265 4.0 (build >= 210); release 5

qboosh qboosh at pld-linux.org
Tue Sep 17 20:32:34 CEST 2024


commit 26575cd3f140e845a32c9849875ec8e2ac4aee60
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Tue Sep 17 20:35:28 2024 +0200

    - added patch for x265 4.0 (build >= 210); release 5

 fceultra-x265.patch | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 fceultra.spec       |  4 ++-
 2 files changed, 74 insertions(+), 1 deletion(-)
---
diff --git a/fceultra.spec b/fceultra.spec
index 1d8eb74..35f1c7b 100644
--- a/fceultra.spec
+++ b/fceultra.spec
@@ -6,7 +6,7 @@ Summary:	FCE Ultra - Linux Nintendo Entertainment System emulator
 Summary(pl.UTF-8):	FCE Ultra - linuksowy emulator systemu Nintendo
 Name:		fceultra
 Version:	2.6.6
-Release:	4
+Release:	5
 License:	GPL v2+
 Group:		X11/Applications/Games
 #Source0Download: https://fceux.com/web/download.html
@@ -14,6 +14,7 @@ Group:		X11/Applications/Games
 #Source0:	https://github.com/TASEmulators/fceux/archive/v%{version}/fceux-%{version}.tar.gz
 Source0:	https://github.com/TASEmulators/fceux/archive/refs/tags/v%{version}.tar.gz
 # Source0-md5:	8e1aede624ebe26f0a936daba3b87328
+Patch0:		%{name}-x265.patch
 URL:		https://fceux.com/
 BuildRequires:	OpenGL-devel
 BuildRequires:	SDL2-devel >= 2.0
@@ -58,6 +59,7 @@ FCE Ultra to wieloplatformowy emulator konsoli Famicom/NES/Pegasus.
 
 %prep
 %setup -q -n fceux-%{version}
+%patch0 -p1
 
 %build
 CFLAGS="%{rpmcflags}"
diff --git a/fceultra-x265.patch b/fceultra-x265.patch
new file mode 100644
index 0000000..b43c0ac
--- /dev/null
+++ b/fceultra-x265.patch
@@ -0,0 +1,71 @@
+--- fceux-2.6.6/src/drivers/Qt/AviRecord.cpp.orig	2023-08-26 19:04:21.000000000 +0200
++++ fceux-2.6.6/src/drivers/Qt/AviRecord.cpp	2024-09-17 19:22:44.360288805 +0200
+@@ -388,7 +388,13 @@ namespace X265
+ {
+ static x265_param *param = NULL;
+ static x265_picture *pic = NULL;
++static x265_picture *pic_outp = NULL;
++#if X265_BUILD >= 210
++static x265_picture pic_outl[MAX_SCALABLE_LAYERS];
++static x265_picture* pic_outlp[MAX_SCALABLE_LAYERS];
++#else
+ static x265_picture pic_out;
++#endif
+ static x265_encoder *hdl = NULL;
+ static x265_nal *nal = NULL;
+ static unsigned int i_nal = 0;
+@@ -420,6 +426,12 @@ static int init( int width, int height )
+ 	param->fpsNum   = 1000000;
+ 	param->fpsDenom = usec;
+ 	
++#if X265_BUILD >= 210
++	for (int i = 0; i < MAX_SCALABLE_LAYERS; i++) pic_outlp[i] = &pic_outp[i];
++	pic_outp = pic_outlp[0];
++#else
++	pic_outp = &pic_out;
++#endif
+ 	/* Apply profile restrictions. */
+ 	//if( x265_param_apply_profile( param, "high" ) < 0 )
+ 	//{
+@@ -460,7 +472,11 @@ static int encode_frame( unsigned char *
+ 	pic->stride[1] = width/2;
+ 	pic->stride[2] = width/2;
+ 
++#if X265_BUILD >= 210
++	ret = x265_encoder_encode( hdl, &nal, &i_nal, pic, pic_outlp );
++#else
+ 	ret = x265_encoder_encode( hdl, &nal, &i_nal, pic, &pic_out );
++#endif
+ 
+ 	if ( ret <= 0 )
+ 	{
+@@ -471,7 +487,7 @@ static int encode_frame( unsigned char *
+ 		flags = 0;
+ 		totalPayload = 0;
+ 
+-		if ( IS_X265_TYPE_I(pic_out.sliceType) )
++		if ( IS_X265_TYPE_I(pic_outp->sliceType) )
+ 		{
+ 			flags |= gwavi_t::IF_KEYFRAME;
+ 		}
+@@ -493,7 +509,11 @@ static int close(void)
+ 	/* Flush delayed frames */
+ 	while( hdl != NULL )
+ 	{
++#if X265_BUILD >= 210
++	    ret = x265_encoder_encode( hdl, &nal, &i_nal, NULL, pic_outlp );
++#else
+ 	    ret = x265_encoder_encode( hdl, &nal, &i_nal, NULL, &pic_out );
++#endif
+ 
+ 	    if ( ret <= 0 )
+ 	    {
+@@ -504,7 +524,7 @@ static int close(void)
+ 		totalPayload = 0;
+ 		flags = 0;
+ 
+-		if ( IS_X265_TYPE_I(pic_out.sliceType) )
++		if ( IS_X265_TYPE_I(pic_outp->sliceType) )
+ 		{
+ 			flags |= gwavi_t::IF_KEYFRAME;
+ 		}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/fceultra.git/commitdiff/26575cd3f140e845a32c9849875ec8e2ac4aee60



More information about the pld-cvs-commit mailing list