Skip to content

Commit 4a47b4d

Browse files
committed
Don't abort Qt module if QT_QPA_PLATFORM is set to offscreen
1 parent b7bc13a commit 4a47b4d

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/modules/glaxnimate/producer_glaxnimate.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,15 @@ static bool createQApplicationIfNeeded(mlt_service service)
141141
#endif
142142
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
143143
if (getenv("DISPLAY") == 0 && getenv("WAYLAND_DISPLAY") == 0) {
144-
mlt_log_error(service,
144+
const char* s = getenv("QT_QPA_PLATFORM");
145+
if (s == 0 || strcmp(s, "offscreen") != 0) {
146+
mlt_log_error(service,
145147
"The MLT Glaxnimate module requires a X11 or Wayland environment.\n"
146148
"Please either run melt from a session with a display server or use a "
147149
"fake X server like xvfb:\n"
148150
"xvfb-run -a melt (...)\n");
149-
return false;
151+
return false;
152+
}
150153
}
151154
#endif
152155
if (!mlt_properties_get(mlt_global_properties(), "qt_argv"))

src/modules/qt/common.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,15 @@ bool createQApplicationIfNeeded(mlt_service service)
3737
#endif
3838
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID)
3939
if (getenv("DISPLAY") == 0 && getenv("WAYLAND_DISPLAY") == 0) {
40-
mlt_log_error(service,
40+
const char* s = getenv("QT_QPA_PLATFORM");
41+
if (s == 0 || strcmp(s, "offscreen") != 0) {
42+
mlt_log_error(service,
4143
"The MLT Qt module requires a X11 or Wayland environment.\n"
4244
"Please either run melt from a session with a display server or use a "
4345
"fake X server like xvfb:\n"
4446
"xvfb-run -a melt (...)\n");
45-
return false;
47+
return false;
48+
}
4649
}
4750
#endif
4851
if (!mlt_properties_get(mlt_global_properties(), "qt_argv"))

0 commit comments

Comments
 (0)