summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodeo <[email protected]>2015-04-05 18:18:01 +0000
committerRodeo <[email protected]>2015-04-05 18:18:01 +0000
commit402696774df73cd37376dd5e4cdbeb52bb234b5b (patch)
tree0627f62f81781220b4a9faa052a3db97583cb3b7
parentbec8c2ffdc53beda254721b9a6fac52a7fec0919 (diff)
x265: fix a conflict between Live Preview and the current job.
x265_cleanup would happily let x265_encoder_open overwrite the global CTU settings. Now it does nothing if an encode is in progress; any new encode will fail (if the CTU size differs), but the current encode will be unaffected. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7056 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--contrib/x265/A01-x265-cleanup-nop.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/contrib/x265/A01-x265-cleanup-nop.patch b/contrib/x265/A01-x265-cleanup-nop.patch
new file mode 100644
index 000000000..a9d209d77
--- /dev/null
+++ b/contrib/x265/A01-x265-cleanup-nop.patch
@@ -0,0 +1,49 @@
+diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
+--- a/source/CMakeLists.txt
++++ b/source/CMakeLists.txt
+@@ -30,7 +30,7 @@
+ mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)
+
+ # X265_BUILD must be incremented each time the public API is changed
+-set(X265_BUILD 51)
++set(X265_BUILD 52)
+ configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
+ "${PROJECT_BINARY_DIR}/x265.def")
+ configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
+diff --git a/source/common/param.cpp b/source/common/param.cpp
+--- a/source/common/param.cpp
++++ b/source/common/param.cpp
+@@ -1183,7 +1183,7 @@
+ uint32_t maxLog2CUSize = (uint32_t)g_log2Size[param->maxCUSize];
+ uint32_t minLog2CUSize = (uint32_t)g_log2Size[param->minCUSize];
+
+- if (g_ctuSizeConfigured || ATOMIC_INC(&g_ctuSizeConfigured) > 1)
++ if (ATOMIC_INC(&g_ctuSizeConfigured) > 1)
+ {
+ if (g_maxCUSize != param->maxCUSize)
+ {
+diff --git a/source/encoder/api.cpp b/source/encoder/api.cpp
+--- a/source/encoder/api.cpp
++++ b/source/encoder/api.cpp
+@@ -177,15 +177,18 @@
+ encoder->printSummary();
+ encoder->destroy();
+ delete encoder;
++ ATOMIC_DEC(&g_ctuSizeConfigured);
+ }
+ }
+
+ extern "C"
+ void x265_cleanup(void)
+ {
+- BitCost::destroy();
+- CUData::s_partSet[0] = NULL; /* allow CUData to adjust to new CTU size */
+- g_ctuSizeConfigured = 0;
++ if (!g_ctuSizeConfigured)
++ {
++ BitCost::destroy();
++ CUData::s_partSet[0] = NULL; /* allow CUData to adjust to new CTU size */
++ }
+ }
+
+ extern "C"