From bcd840f5fac3e8bf0ba57673230f97bf315fb52d Mon Sep 17 00:00:00 2001 From: Richard Stanway Date: Thu, 31 Mar 2022 17:22:22 +0200 Subject: [PATCH 1/8] UI: Fix display affinity logic when re-applying The old behavior toggled display affinity every time the window was updated instead of applying it consistently. --- UI/window-basic-main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index a1ffc621fa48a0..f61aa1dd72fbc9 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -9974,7 +9974,7 @@ void OBSBasic::SetDisplayAffinity(QWindow *window) if (GetWindowDisplayAffinity(hwnd, &curAffinity)) { if (hideFromCapture && curAffinity != WDA_EXCLUDEFROMCAPTURE) SetWindowDisplayAffinity(hwnd, WDA_EXCLUDEFROMCAPTURE); - else if (curAffinity != WDA_NONE) + else if (!hideFromCapture && curAffinity != WDA_NONE) SetWindowDisplayAffinity(hwnd, WDA_NONE); } From 7a73c13ab5916350bd23cee47c38f1bd4d15c9a1 Mon Sep 17 00:00:00 2001 From: gxalpha Date: Tue, 5 Apr 2022 01:52:20 +0200 Subject: [PATCH 2/8] UI: Truncate displayed file paths in the middle in Remux window --- UI/window-remux.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/UI/window-remux.cpp b/UI/window-remux.cpp index a0dbcc543520a5..81c00fc5d9c3f4 100644 --- a/UI/window-remux.cpp +++ b/UI/window-remux.cpp @@ -672,6 +672,8 @@ OBSRemux::OBSRemux(const char *path, QWidget *parent, bool autoRemux_) RemuxEntryColumn::State, QHeaderView::ResizeMode::Fixed); ui->tableView->setEditTriggers( QAbstractItemView::EditTrigger::CurrentChanged); + ui->tableView->setTextElideMode(Qt::ElideMiddle); + ui->tableView->setWordWrap(false); installEventFilter(CreateShortcutFilter()); From 977ef4766ee4849e7d1a24f06d045401a284923c Mon Sep 17 00:00:00 2001 From: wangshaohui Date: Fri, 1 Apr 2022 11:30:33 +0800 Subject: [PATCH 3/8] libobs: Fix image source not loading upper case file extensions --- libobs/graphics/image-file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libobs/graphics/image-file.c b/libobs/graphics/image-file.c index b7c39d4dc7335d..5babb1f708feb0 100644 --- a/libobs/graphics/image-file.c +++ b/libobs/graphics/image-file.c @@ -18,6 +18,7 @@ #include "image-file.h" #include "../util/base.h" #include "../util/platform.h" +#include "../util/dstr.h" #include "vec4.h" #define blog(level, format, ...) \ @@ -206,7 +207,7 @@ static void gs_image_file_init_internal(gs_image_file_t *image, len = strlen(file); - if (len > 4 && strcmp(file + len - 4, ".gif") == 0) { + if (len > 4 && astrcmpi(file + len - 4, ".gif") == 0) { if (init_animated_gif(image, file, mem_usage, alpha_mode)) { return; } From 8b5f990620b7765fcdfa7a50bf557abf3e2b1e68 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Thu, 7 Apr 2022 00:26:56 +0000 Subject: [PATCH 4/8] linux-capture: Don't initialize format info if init_obs_pipewire fails The pointer has been freed by this point so it just segfaults. Signed-off-by: Joshua Ashton --- plugins/linux-capture/pipewire.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/linux-capture/pipewire.c b/plugins/linux-capture/pipewire.c index 07b94d43968aee..f365d0723f35de 100644 --- a/plugins/linux-capture/pipewire.c +++ b/plugins/linux-capture/pipewire.c @@ -1434,8 +1434,10 @@ void *obs_pipewire_create(enum obs_pw_capture_type capture_type, obs_pw->restore_token = bstrdup(obs_data_get_string(settings, "RestoreToken")); - if (!init_obs_pipewire(obs_pw)) + if (!init_obs_pipewire(obs_pw)) { g_clear_pointer(&obs_pw, bfree); + return NULL; + } init_format_info(obs_pw); From 916bfecc9dc71246c3c66e9c5689ea9b11315ccb Mon Sep 17 00:00:00 2001 From: tt2468 Date: Wed, 30 Mar 2022 03:10:28 -0700 Subject: [PATCH 5/8] libobs, UI: Fix `--verbose` logging for stdout Verbosity of stdout was previously hardcoded to INFO, while log viewer and log files had correct verbosity. This makes the behavior of --verbose make sense in all places. --- UI/obs-app.cpp | 15 +++++++++------ libobs/util/base.c | 46 +++++++++++++++++++--------------------------- 2 files changed, 28 insertions(+), 33 deletions(-) diff --git a/UI/obs-app.cpp b/UI/obs-app.cpp index 4ba4e10f0b8870..707f07227913b9 100644 --- a/UI/obs-app.cpp +++ b/UI/obs-app.cpp @@ -389,21 +389,24 @@ static void do_log(int log_level, const char *msg, va_list args, void *param) OutputDebugStringW(wide_buf.c_str()); } } -#else - def_log_handler(log_level, msg, args2, nullptr); - va_end(args2); #endif if (log_level <= LOG_INFO || log_verbose) { - if (too_many_repeated_entries(logFile, msg, str)) - return; - LogStringChunk(logFile, str, log_level); +#ifndef _WIN32 + def_log_handler(log_level, msg, args2, nullptr); +#endif + if (!too_many_repeated_entries(logFile, msg, str)) + LogStringChunk(logFile, str, log_level); } #if defined(_WIN32) && defined(OBS_DEBUGBREAK_ON_ERROR) if (log_level <= LOG_ERROR && IsDebuggerPresent()) __debugbreak(); #endif + +#ifndef _WIN32 + va_end(args2); +#endif } #define DEFAULT_LANG "en-US" diff --git a/libobs/util/base.c b/libobs/util/base.c index 8d1f15c60e4ff3..0aabf12c1b0b72 100644 --- a/libobs/util/base.c +++ b/libobs/util/base.c @@ -20,12 +20,6 @@ #include "c99defs.h" #include "base.h" -#ifdef _DEBUG -static int log_output_level = LOG_DEBUG; -#else -static int log_output_level = LOG_INFO; -#endif - static int crashing = 0; static void *log_param = NULL; static void *crash_param = NULL; @@ -36,27 +30,25 @@ static void def_log_handler(int log_level, const char *format, va_list args, char out[4096]; vsnprintf(out, sizeof(out), format, args); - if (log_level <= log_output_level) { - switch (log_level) { - case LOG_DEBUG: - fprintf(stdout, "debug: %s\n", out); - fflush(stdout); - break; - - case LOG_INFO: - fprintf(stdout, "info: %s\n", out); - fflush(stdout); - break; - - case LOG_WARNING: - fprintf(stdout, "warning: %s\n", out); - fflush(stdout); - break; - - case LOG_ERROR: - fprintf(stderr, "error: %s\n", out); - fflush(stderr); - } + switch (log_level) { + case LOG_DEBUG: + fprintf(stdout, "debug: %s\n", out); + fflush(stdout); + break; + + case LOG_INFO: + fprintf(stdout, "info: %s\n", out); + fflush(stdout); + break; + + case LOG_WARNING: + fprintf(stdout, "warning: %s\n", out); + fflush(stdout); + break; + + case LOG_ERROR: + fprintf(stderr, "error: %s\n", out); + fflush(stderr); } UNUSED_PARAMETER(param); From b448e49d0da8f26cb81773f6e140f68fac34563e Mon Sep 17 00:00:00 2001 From: mvji <33432858+mvji@users.noreply.github.com> Date: Tue, 12 Apr 2022 11:15:23 -0400 Subject: [PATCH 6/8] obs-ffmpeg: Add mxf extension to open file dialog --- plugins/obs-ffmpeg/obs-ffmpeg-source.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/obs-ffmpeg/obs-ffmpeg-source.c b/plugins/obs-ffmpeg/obs-ffmpeg-source.c index 73b7bf62e13118..c76061b3b1b574 100644 --- a/plugins/obs-ffmpeg/obs-ffmpeg-source.c +++ b/plugins/obs-ffmpeg/obs-ffmpeg-source.c @@ -117,9 +117,9 @@ static void ffmpeg_source_defaults(obs_data_t *settings) } static const char *media_filter = - " (*.mp4 *.ts *.mov *.flv *.mkv *.avi *.mp3 *.ogg *.aac *.wav *.gif *.webm);;"; + " (*.mp4 *.ts *.mov *.mxf *.flv *.mkv *.avi *.mp3 *.ogg *.aac *.wav *.gif *.webm);;"; static const char *video_filter = - " (*.mp4 *.ts *.mov *.flv *.mkv *.avi *.gif *.webm);;"; + " (*.mp4 *.ts *.mov *.mxf *.flv *.mkv *.avi *.gif *.webm);;"; static const char *audio_filter = " (*.mp3 *.aac *.ogg *.wav);;"; static obs_properties_t *ffmpeg_source_getproperties(void *data) From 0336d4e0f1b691c44377896f39f0927d155c58f1 Mon Sep 17 00:00:00 2001 From: cg2121 Date: Tue, 1 Mar 2022 05:14:47 -0600 Subject: [PATCH 7/8] UI: Fix show/hide toggle with minimize to taskbar If the user would minimize to tray instead of taskbar, the window would flash when clicking show in the tray menu, and the preview would be disabled. This would only happen on Linux. --- UI/window-basic-main.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index f61aa1dd72fbc9..293c8c21e4923f 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -4695,6 +4695,7 @@ void OBSBasic::changeEvent(QEvent *event) if (trayIcon && trayIcon->isVisible() && sysTrayMinimizeToTray()) { ToggleShowHide(); + return; } if (previewEnabled) @@ -8881,9 +8882,10 @@ void OBSBasic::SetShowing(bool showing) if (showHide) showHide->setText(QTStr("Basic.SystemTray.Show")); - QTimer::singleShot(250, this, SLOT(hide())); + QTimer::singleShot(0, this, SLOT(hide())); - setVisible(false); + if (previewEnabled) + EnablePreviewDisplay(false); #ifdef __APPLE__ EnableOSXDockIcon(false); @@ -8892,9 +8894,10 @@ void OBSBasic::SetShowing(bool showing) } else if (showing && !isVisible()) { if (showHide) showHide->setText(QTStr("Basic.SystemTray.Hide")); - QTimer::singleShot(250, this, SLOT(show())); + QTimer::singleShot(0, this, SLOT(show())); - setVisible(true); + if (previewEnabled) + EnablePreviewDisplay(true); #ifdef __APPLE__ EnableOSXDockIcon(true); From 51a088789b18b1cf97e9bbe25b8e53e15339d639 Mon Sep 17 00:00:00 2001 From: Kurt Kartaltepe Date: Sun, 27 Mar 2022 20:44:21 -0700 Subject: [PATCH 8/8] UI: Remove top level size constraints This removes the min and max size properties from the YouTube "Manage Broadcast" dialog. Such values depend on the actual content or very precise layout management, making hardcoded values prone to being incorrect. To avoid incorrect values we should avoid these settings on top level widgets/windows. This pattern can lead to crashes on Wayland compositors like GNOME which are strict about these values being correct. --- UI/forms/OBSYoutubeActions.ui | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/UI/forms/OBSYoutubeActions.ui b/UI/forms/OBSYoutubeActions.ui index 2495c9ce494fe9..d6261312eaf814 100644 --- a/UI/forms/OBSYoutubeActions.ui +++ b/UI/forms/OBSYoutubeActions.ui @@ -16,18 +16,6 @@ 0 - - - 0 - 0 - - - - - 720 - 880 - - YouTube.Actions.WindowTitle