From fa8b489aa4417c26a65159cc635a77fa0ecb2cb1 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <randrianasulu@gmail.com>
Date: Fri, 23 Jul 2021 14:10:25 +0300
Subject: [PATCH 2/2] fix mjpegtools patch4 and patch5 (termux)

---
 .../thirdparty/src/mjpegtools-2.1.0.patch4    | 34 ++++++++++---------
 .../thirdparty/src/mjpegtools-2.1.0.patch5    | 14 ++++----
 2 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/cinelerra-5.1/thirdparty/src/mjpegtools-2.1.0.patch4 b/cinelerra-5.1/thirdparty/src/mjpegtools-2.1.0.patch4
index 22cc2141..d0bbfd1e 100644
--- a/cinelerra-5.1/thirdparty/src/mjpegtools-2.1.0.patch4
+++ b/cinelerra-5.1/thirdparty/src/mjpegtools-2.1.0.patch4
@@ -1,17 +1,19 @@
---- mjpegtools-2.1.0/y4mdenoise/newdenoise.cc	2009-04-26 21:40:20.000000000 +0400
-+++ mjpegtools-2.1.0/y4mdenoise/newdenoise.cc.new	2021-05-23 09:27:12.071050661 +0300
-@@ -1853,12 +1853,14 @@
-		mjpeg_error_exit1 ("pthread_attr_init() failed: %s",
-			strerror (nErr));
-
+--- mjpegtools-2.1.0/y4mdenoise/newdenoise.cc.orig	2021-07-23 14:03:35.999564700 +0300
++++ mjpegtools-2.1.0/y4mdenoise/newdenoise.cc	2021-07-23 14:04:35.779564703 +0300
+@@ -1852,14 +1852,14 @@
+ 	if (nErr != 0)
+ 		mjpeg_error_exit1 ("pthread_attr_init() failed: %s",
+ 			strerror (nErr));
+-
 +#if !defined(__TERMUX__)
-	// Inherit scheduling parameters from the main thread.
-	nErr = pthread_attr_setinheritsched (&sThreadAttributes,
-		PTHREAD_INHERIT_SCHED);
-	if (nErr != 0)
-		mjpeg_error_exit1 ("pthread_attr_setinheritsched() failed: %s",
-			strerror (nErr));
-+#endif /* termux */
-
-	// Create the thread.
-	nErr = pthread_create (&m_oThreadInfo,
+ 	// Inherit scheduling parameters from the main thread.
+ 	nErr = pthread_attr_setinheritsched (&sThreadAttributes,
+ 		PTHREAD_INHERIT_SCHED);
+ 	if (nErr != 0)
+ 		mjpeg_error_exit1 ("pthread_attr_setinheritsched() failed: %s",
+ 			strerror (nErr));
+-	
++#endif
+ 	// Create the thread.
+ 	nErr = pthread_create (&m_oThreadInfo,
+ 		&sThreadAttributes, WorkLoop, (void *)this);
diff --git a/cinelerra-5.1/thirdparty/src/mjpegtools-2.1.0.patch5 b/cinelerra-5.1/thirdparty/src/mjpegtools-2.1.0.patch5
index abb3cecd..cbb9d408 100644
--- a/cinelerra-5.1/thirdparty/src/mjpegtools-2.1.0.patch5
+++ b/cinelerra-5.1/thirdparty/src/mjpegtools-2.1.0.patch5
@@ -1,11 +1,11 @@
---- mjpegtools-2.1.0/mpeg2enc/Makefile.am.orig	2010-09-11 23:46:04.000000000 +0400
-+++ mjpegtools-2.1.0/mpeg2enc/Makefile.am	2021-05-23 09:39:14.731050704 +0300
+--- mjpegtools-2.1.0/mpeg2enc/Makefile.am.orig	2021-07-23 14:01:12.127564691 +0300
++++ mjpegtools-2.1.0/mpeg2enc/Makefile.am	2021-07-23 14:01:42.959564693 +0300
 @@ -3,7 +3,7 @@
  # and mpeg2enc command line wrapper.
  #
-
--bin_PROGRAMS = mpeg2enc
-+#bin_PROGRAMS = mpeg2enc
-
+ 
+-bin_PROGRAMS = mpeg2enc 
++#bin_PROGRAMS = mpeg2enc 
+ 
  mpeg2encpp_MMXSSE_INLINE = \
-	fdct_x86.c \
+ 	fdct_x86.c \
-- 
2.32.0

