summaryrefslogtreecommitdiffstats
path: root/recipes-multimedia/onevpl/files/0002-Fix-sample_multi_transcode-segfault-on-wayland.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-multimedia/onevpl/files/0002-Fix-sample_multi_transcode-segfault-on-wayland.patch')
-rw-r--r--recipes-multimedia/onevpl/files/0002-Fix-sample_multi_transcode-segfault-on-wayland.patch87
1 files changed, 0 insertions, 87 deletions
diff --git a/recipes-multimedia/onevpl/files/0002-Fix-sample_multi_transcode-segfault-on-wayland.patch b/recipes-multimedia/onevpl/files/0002-Fix-sample_multi_transcode-segfault-on-wayland.patch
deleted file mode 100644
index b7762709..00000000
--- a/recipes-multimedia/onevpl/files/0002-Fix-sample_multi_transcode-segfault-on-wayland.patch
+++ /dev/null
@@ -1,87 +0,0 @@
1From 72ef4e2878f8cc2df431411027c92dc41ff26a2b Mon Sep 17 00:00:00 2001
2From: Vincent Cheah Beng Keat <vincent.beng.keat.cheah@intel.com>
3Date: Wed, 15 Mar 2023 22:37:08 +0800
4Subject: [PATCH 2/5] Fix sample_multi_transcode segfault on wayland
5
6HSD ID: 15012772965
7Tested command: ./sample_multi_transcode -par ../../config.par
8
9Upstream-Status: Backport
10Expect it to be removed once move to v2023.2.0 and above.
11https://github.com/oneapi-src/oneVPL/commit/59c850db505d32e6b7e4d68ced8d714afe390a70
12---
13 .../sample_misc/wayland/src/class_wayland.cpp | 27 +++++++++++++++----
14 .../src/pipeline_transcode.cpp | 6 ++++-
15 2 files changed, 27 insertions(+), 6 deletions(-)
16
17diff --git a/tools/legacy/sample_misc/wayland/src/class_wayland.cpp b/tools/legacy/sample_misc/wayland/src/class_wayland.cpp
18index 8f6edbb..af4d3f3 100644
19--- a/tools/legacy/sample_misc/wayland/src/class_wayland.cpp
20+++ b/tools/legacy/sample_misc/wayland/src/class_wayland.cpp
21@@ -144,19 +144,36 @@ bool Wayland::CreateSurface() {
22 }
23
24 void Wayland::FreeSurface() {
25- if (NULL != m_shell_surface)
26+ if (NULL != m_shell_surface) {
27 wl_shell_surface_destroy(m_shell_surface);
28- if (NULL != m_surface)
29+ m_shell_surface = NULL;
30+ }
31+ if (NULL != m_surface) {
32+ while (!m_buffers_list.empty()) {
33+ wl_surface_attach(m_surface, NULL, 0, 0);
34+ wl_surface_commit(m_surface);
35+ if (wl_display_dispatch_queue(m_display, m_event_queue) < 1)
36+ break;
37+ }
38+
39 wl_surface_destroy(m_surface);
40+ m_surface = NULL;
41+ }
42 #if defined(WAYLAND_LINUX_XDG_SHELL_SUPPORT)
43- if (NULL != m_xdg_toplevel)
44+ if (NULL != m_xdg_toplevel) {
45 xdg_toplevel_destroy(m_xdg_toplevel);
46- if (NULL != m_xdg_surface)
47+ m_xdg_toplevel = NULL;
48+ }
49+ if (NULL != m_xdg_surface) {
50 xdg_surface_destroy(m_xdg_surface);
51+ m_xdg_surface = NULL;
52+ }
53 #endif
54 #if defined(WAYLAND_LINUX_DMABUF_SUPPORT)
55- if (NULL != m_dmabuf)
56+ if (NULL != m_dmabuf) {
57 zwp_linux_dmabuf_v1_destroy(m_dmabuf);
58+ m_dmabuf = NULL;
59+ }
60 #endif
61 }
62
63diff --git a/tools/legacy/sample_multi_transcode/src/pipeline_transcode.cpp b/tools/legacy/sample_multi_transcode/src/pipeline_transcode.cpp
64index 1c39daf..5e69a94 100644
65--- a/tools/legacy/sample_multi_transcode/src/pipeline_transcode.cpp
66+++ b/tools/legacy/sample_multi_transcode/src/pipeline_transcode.cpp
67@@ -4675,12 +4675,16 @@ void CTranscodingPipeline::Close() {
68 m_bIsJoinSession = false;
69 }
70
71- //Destroy renderer
72 #if defined(_WIN32) || defined(_WIN64)
73+ //Destroy renderer
74 if (m_hwdev4Rendering) {
75 delete m_hwdev4Rendering;
76 m_hwdev4Rendering = NULL;
77 }
78+#else
79+ if (m_hwdev4Rendering) {
80+ m_hwdev4Rendering->Close();
81+ }
82 #endif
83
84 if (m_b3DLutEnable) {
85--
862.40.1
87