Changes of Revision 74

obs-studio.changes Changed
x
 
1
@@ -1,4 +1,22 @@
2
 -------------------------------------------------------------------
3
+Thu Mar 19 19:26:37 UTC 2020 - jimmy@boombatower.com
4
+
5
+- Update to version 25.0.1:
6
+  * libobs: Update version to 25.0.1
7
+  * libobs-winrt: Fix missing parentheses
8
+  * UI: Fix memory leak
9
+  * Revert "win-capture, libobs: Show names of displays in Display Capture"
10
+  * obs-browser: Fix a few crashes
11
+  * UI: Fix preview state when minimizing to tray
12
+  * UI: Remove unnecessary vertices for preview
13
+  * UI: Get actual projector monitor name on windows
14
+  * obs-ffmpeg: Make sure to show FFmpeg NVENC on non-windows
15
+  * libobs-winrt: Catch more hresult exceptions
16
+  * win-capture: Retry with last known window if first fails
17
+  * UI: Restart when browser hardware acceleration changed
18
+  * libobs-winrt: win-capture: Clean up error handling
19
+
20
+-------------------------------------------------------------------
21
 Wed Mar 18 18:46:43 UTC 2020 - jimmy@boombatower.com
22
 
23
 - Update to version 25.0.0:
24
obs-studio.spec Changed
8
 
1
@@ -1,5 +1,5 @@
2
 Name:           obs-studio
3
-Version:        25.0.0
4
+Version:        25.0.1
5
 Release:        0
6
 Summary:        A recording/broadcasting program
7
 Group:          Productivity/Multimedia/Video/Editors and Convertors
8
_service Changed
10
 
1
@@ -1,7 +1,7 @@
2
 <services>
3
   <service name="tar_scm" mode="disabled">
4
     <param name="versionformat">@PARENT_TAG@</param>
5
-    <param name="revision">refs/tags/25.0.0</param>
6
+    <param name="revision">refs/tags/25.0.1</param>
7
     <param name="url">git://github.com/jp9000/obs-studio.git</param>
8
     <param name="scm">git</param>
9
     <param name="changesgenerate">enable</param>
10
_servicedata Changed
9
 
1
@@ -1,6 +1,6 @@
2
 <servicedata>
3
   <service name="tar_scm">
4
     <param name="url">git://github.com/jp9000/obs-studio.git</param>
5
-    <param name="changesrevision">327a6f599e7ae1d48a288ec3885ff3cd8b7bf538</param>
6
+    <param name="changesrevision">b19ea6fe3516a7a8bdf44f50bb95a36f4681330d</param>
7
   </service>
8
 </servicedata>
9
obs-studio-25.0.0.tar.xz/UI/platform-windows.cpp -> obs-studio-25.0.1.tar.xz/UI/platform-windows.cpp Changed
96
 
1
@@ -19,6 +19,7 @@
2
 #include <sstream>
3
 #include "obs-config.h"
4
 #include "obs-app.hpp"
5
+#include "qt-wrappers.hpp"
6
 #include "platform.hpp"
7
 
8
 #include <util/windows/win-version.h>
9
@@ -330,3 +331,86 @@
10
    RunOnceMutex rom(h ? new RunOnceMutexData(h) : nullptr);
11
    return rom;
12
 }
13
+
14
+struct MonitorData {
15
+   const wchar_t *id;
16
+   MONITORINFOEX info;
17
+   bool found;
18
+};
19
+
20
+static BOOL CALLBACK GetMonitorCallback(HMONITOR monitor, HDC, LPRECT,
21
+                   LPARAM param)
22
+{
23
+   MonitorData *data = (MonitorData *)param;
24
+
25
+   if (GetMonitorInfoW(monitor, &data->info)) {
26
+       if (wcscmp(data->info.szDevice, data->id) == 0) {
27
+           data->found = true;
28
+           return false;
29
+       }
30
+   }
31
+
32
+   return true;
33
+}
34
+
35
+#define GENERIC_MONITOR_NAME QStringLiteral("Generic PnP Monitor")
36
+
37
+QString GetMonitorName(const QString &id)
38
+{
39
+   MonitorData data = {};
40
+   data.id = (const wchar_t *)id.utf16();
41
+   data.info.cbSize = sizeof(data.info);
42
+
43
+   EnumDisplayMonitors(nullptr, nullptr, GetMonitorCallback,
44
+               (LPARAM)&data);
45
+   if (!data.found) {
46
+       return GENERIC_MONITOR_NAME;
47
+   }
48
+
49
+   UINT32 numPath, numMode;
50
+   if (!GetDisplayConfigBufferSizes(QDC_ONLY_ACTIVE_PATHS, &numPath,
51
+                    &numMode) == ERROR_SUCCESS) {
52
+       return GENERIC_MONITOR_NAME;
53
+   }
54
+
55
+   std::vector<DISPLAYCONFIG_PATH_INFO> paths(numPath);
56
+   std::vector<DISPLAYCONFIG_MODE_INFO> modes(numMode);
57
+
58
+   if (!QueryDisplayConfig(QDC_ONLY_ACTIVE_PATHS, &numPath, paths.data(),
59
+               &numMode, modes.data(),
60
+               nullptr) == ERROR_SUCCESS) {
61
+       return GENERIC_MONITOR_NAME;
62
+   }
63
+
64
+   DISPLAYCONFIG_TARGET_DEVICE_NAME target;
65
+   bool found = false;
66
+
67
+   paths.resize(numPath);
68
+   for (size_t i = 0; i < numPath; ++i) {
69
+       const DISPLAYCONFIG_PATH_INFO &path = paths[i];
70
+
71
+       DISPLAYCONFIG_SOURCE_DEVICE_NAME s;
72
+       s.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME;
73
+       s.header.size = sizeof(s);
74
+       s.header.adapterId = path.sourceInfo.adapterId;
75
+       s.header.id = path.sourceInfo.id;
76
+
77
+       if (DisplayConfigGetDeviceInfo(&s.header) == ERROR_SUCCESS &&
78
+           wcscmp(data.info.szDevice, s.viewGdiDeviceName) == 0) {
79
+           target.header.type =
80
+               DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME;
81
+           target.header.size = sizeof(target);
82
+           target.header.adapterId = path.sourceInfo.adapterId;
83
+           target.header.id = path.targetInfo.id;
84
+           found = DisplayConfigGetDeviceInfo(&target.header) ==
85
+               ERROR_SUCCESS;
86
+           break;
87
+       }
88
+   }
89
+
90
+   if (!found) {
91
+       return GENERIC_MONITOR_NAME;
92
+   }
93
+
94
+   return QString::fromWCharArray(target.monitorFriendlyDeviceName);
95
+}
96
obs-studio-25.0.0.tar.xz/UI/platform.hpp -> obs-studio-25.0.1.tar.xz/UI/platform.hpp Changed
9
 
1
@@ -60,6 +60,7 @@
2
 };
3
 
4
 RunOnceMutex GetRunOnceMutex(bool &already_running);
5
+QString GetMonitorName(const QString &id);
6
 #endif
7
 
8
 #ifdef __APPLE__
9
obs-studio-25.0.0.tar.xz/UI/window-basic-main-scene-collections.cpp -> obs-studio-25.0.1.tar.xz/UI/window-basic-main-scene-collections.cpp Changed
9
 
1
@@ -392,6 +392,7 @@
2
    OBSImporter *imp;
3
    imp = new OBSImporter(this);
4
    imp->exec();
5
+   delete imp;
6
 
7
    RefreshSceneCollections();
8
 }
9
obs-studio-25.0.0.tar.xz/UI/window-basic-main.cpp -> obs-studio-25.0.1.tar.xz/UI/window-basic-main.cpp Changed
53
 
1
@@ -29,6 +29,7 @@
2
 #include <QColorDialog>
3
 #include <QSizePolicy>
4
 #include <QScrollBar>
5
+#include <QTextStream>
6
 
7
 #include <util/dstr.h>
8
 #include <util/util.hpp>
9
@@ -1451,9 +1452,8 @@
10
    gs_render_start(true);
11
    gs_vertex2f(0.0f, 0.0f);
12
    gs_vertex2f(0.0f, 1.0f);
13
-   gs_vertex2f(1.0f, 1.0f);
14
    gs_vertex2f(1.0f, 0.0f);
15
-   gs_vertex2f(0.0f, 0.0f);
16
+   gs_vertex2f(1.0f, 1.0f);
17
    box = gs_render_save();
18
 
19
    gs_render_start(true);
20
@@ -4173,15 +4173,11 @@
21
        QRect screenGeometry = screen->geometry();
22
        QString name = "";
23
 #ifdef _WIN32
24
-       DISPLAY_DEVICE ddev;
25
-       ddev.cb = sizeof(ddev);
26
-       BPtr<wchar_t> wideName;
27
-       os_utf8_to_wcs_ptr(screen->name().toStdString().c_str(), 0,
28
-                  &wideName);
29
-       EnumDisplayDevices(wideName, 0, &ddev, 1);
30
-       BPtr<char> newName;
31
-       os_wcs_to_utf8_ptr(ddev.DeviceString, 0, &newName);
32
-       name = newName;
33
+       QTextStream fullname(&name);
34
+       fullname << GetMonitorName(screen->name());
35
+       fullname << " (";
36
+       fullname << (i + 1);
37
+       fullname << ")";
38
 #elif defined(__APPLE__)
39
        name = screen->name();
40
 #elif QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)
41
@@ -7184,8 +7180,10 @@
42
    AddProjectorMenuMonitors(studioProgramProjector, this,
43
                 SLOT(OpenStudioProgramProjector()));
44
 
45
-   if (reason == QSystemTrayIcon::Trigger)
46
+   if (reason == QSystemTrayIcon::Trigger) {
47
+       EnablePreviewDisplay(previewEnabled && !isVisible());
48
        ToggleShowHide();
49
+   }
50
 }
51
 
52
 void OBSBasic::SysTrayNotify(const QString &text,
53
obs-studio-25.0.0.tar.xz/UI/window-basic-preview.cpp -> obs-studio-25.0.1.tar.xz/UI/window-basic-preview.cpp Changed
54
 
1
@@ -1514,10 +1514,9 @@
2
    gs_vertex2f(x1, y1);
3
    gs_vertex2f(x1 + (xSide * (thickness / scale.x)),
4
            y1 + (ySide * (thickness / scale.y)));
5
+   gs_vertex2f(x2, y2);
6
    gs_vertex2f(x2 + (xSide * (thickness / scale.x)),
7
            y2 + (ySide * (thickness / scale.y)));
8
-   gs_vertex2f(x2, y2);
9
-   gs_vertex2f(x1, y1);
10
 
11
    gs_vertbuffer_t *line = gs_render_save();
12
 
13
@@ -1532,24 +1531,17 @@
14
 
15
    gs_vertex2f(0.0f, 0.0f);
16
    gs_vertex2f(0.0f + (thickness / scale.x), 0.0f);
17
-   gs_vertex2f(0.0f + (thickness / scale.x), 1.0f);
18
-   gs_vertex2f(0.0f, 1.0f);
19
-   gs_vertex2f(0.0f, 0.0f);
20
    gs_vertex2f(0.0f, 1.0f);
21
+   gs_vertex2f(0.0f + (thickness / scale.x), 1.0f);
22
    gs_vertex2f(0.0f, 1.0f - (thickness / scale.y));
23
-   gs_vertex2f(1.0f, 1.0f - (thickness / scale.y));
24
-   gs_vertex2f(1.0f, 1.0f);
25
-   gs_vertex2f(0.0f, 1.0f);
26
    gs_vertex2f(1.0f, 1.0f);
27
+   gs_vertex2f(1.0f, 1.0f - (thickness / scale.y));
28
    gs_vertex2f(1.0f - (thickness / scale.x), 1.0f);
29
-   gs_vertex2f(1.0f - (thickness / scale.x), 0.0f);
30
-   gs_vertex2f(1.0f, 0.0f);
31
-   gs_vertex2f(1.0f, 1.0f);
32
    gs_vertex2f(1.0f, 0.0f);
33
+   gs_vertex2f(1.0f - (thickness / scale.x), 0.0f);
34
    gs_vertex2f(1.0f, 0.0f + (thickness / scale.y));
35
-   gs_vertex2f(0.0f, 0.0f + (thickness / scale.y));
36
    gs_vertex2f(0.0f, 0.0f);
37
-   gs_vertex2f(1.0f, 0.0f);
38
+   gs_vertex2f(0.0f, 0.0f + (thickness / scale.y));
39
 
40
    gs_vertbuffer_t *rect = gs_render_save();
41
 
42
@@ -1897,10 +1889,8 @@
43
 
44
            gs_vertex2f(0.0f, 0.0f);
45
            gs_vertex2f(1.0f, 0.0f);
46
-           gs_vertex2f(1.0f, 1.0f);
47
-           gs_vertex2f(1.0f, 1.0f);
48
-           gs_vertex2f(0.0f, 0.0f);
49
            gs_vertex2f(0.0f, 1.0f);
50
+           gs_vertex2f(1.0f, 1.0f);
51
 
52
            rectFill = gs_render_save();
53
        }
54
obs-studio-25.0.0.tar.xz/UI/window-basic-settings.cpp -> obs-studio-25.0.1.tar.xz/UI/window-basic-settings.cpp Changed
21
 
1
@@ -2440,6 +2440,7 @@
2
    bool browserHWAccel = config_get_bool(App()->GlobalConfig(), "General",
3
                          "BrowserHWAccel");
4
    ui->browserHWAccel->setChecked(browserHWAccel);
5
+   prevBrowserAccel = ui->browserHWAccel->isChecked();
6
 #endif
7
 
8
    SetComboByValue(ui->hotkeyFocusType, hotkeyFocusType);
9
@@ -3534,8 +3535,10 @@
10
    bool langChanged = (ui->language->currentIndex() != prevLangIndex);
11
    bool audioRestart = (ui->channelSetup->currentIndex() != channelIndex ||
12
                 ui->sampleRate->currentIndex() != sampleRateIndex);
13
+   bool browserHWAccelChanged =
14
+       (ui->browserHWAccel->isChecked() != prevBrowserAccel);
15
 
16
-   if (langChanged || audioRestart)
17
+   if (langChanged || audioRestart || browserHWAccelChanged)
18
        restart = true;
19
    else
20
        restart = false;
21
obs-studio-25.0.0.tar.xz/UI/window-basic-settings.hpp -> obs-studio-25.0.1.tar.xz/UI/window-basic-settings.hpp Changed
9
 
1
@@ -235,6 +235,7 @@
2
    void OnAuthConnected();
3
    QString lastService;
4
    int prevLangIndex;
5
+   bool prevBrowserAccel;
6
 private slots:
7
    void UpdateServerList();
8
    void UpdateKeyLink();
9
obs-studio-25.0.0.tar.xz/libobs-d3d11/d3d11-duplicator.cpp -> obs-studio-25.0.1.tar.xz/libobs-d3d11/d3d11-duplicator.cpp Changed
56
 
1
@@ -16,8 +16,6 @@
2
 ******************************************************************************/
3
 
4
 #include "d3d11-subsystem.hpp"
5
-#include "util/platform.h"
6
-#include <map>
7
 #include <unordered_map>
8
 
9
 static inline bool get_monitor(gs_device_t *device, int monitor_idx,
10
@@ -36,16 +34,6 @@
11
    return true;
12
 }
13
 
14
-static inline void get_display_device(DXGI_OUTPUT_DESC *desc,
15
-                     MONITORINFOEX *moninfo,
16
-                     DISPLAY_DEVICE *ddev)
17
-{
18
-   moninfo->cbSize = sizeof(MONITORINFOEX);
19
-   GetMonitorInfoW(desc->Monitor, moninfo);
20
-   ddev->cb = sizeof(*ddev);
21
-   EnumDisplayDevices(moninfo->szDevice, 0, ddev, 1);
22
-}
23
-
24
 void gs_duplicator::Start()
25
 {
26
    ComPtr<IDXGIOutput1> output1;
27
@@ -107,10 +95,6 @@
28
        return false;
29
    }
30
 
31
-   DISPLAY_DEVICE ddev;
32
-   MONITORINFOEX monitorinf;
33
-   get_display_device(&desc, &monitorinf, &ddev);
34
-
35
    switch (desc.Rotation) {
36
    case DXGI_MODE_ROTATION_UNSPECIFIED:
37
    case DXGI_MODE_ROTATION_IDENTITY:
38
@@ -135,17 +119,6 @@
39
    info->cx = desc.DesktopCoordinates.right - info->x;
40
    info->cy = desc.DesktopCoordinates.bottom - info->y;
41
 
42
-   char *devname = NULL;
43
-#ifdef UNICODE
44
-   os_wcs_to_utf8_ptr(ddev.DeviceString, 128, &devname);
45
-#else
46
-   devname = (char *)bstrdup(ddev.DeviceString);
47
-#endif
48
-   info->monitor_name = devname;
49
-   bfree(devname);
50
-
51
-   info->flags = monitorinf.dwFlags;
52
-
53
    return true;
54
 }
55
 
56
obs-studio-25.0.0.tar.xz/libobs-winrt/winrt-capture.cpp -> obs-studio-25.0.1.tar.xz/libobs-winrt/winrt-capture.cpp Changed
100
 
1
@@ -13,15 +13,19 @@
2
 };
3
 
4
 extern "C" EXPORT BOOL winrt_capture_supported()
5
-{
6
-   return winrt::Windows::Foundation::Metadata::ApiInformation::IsTypePresent(
7
-              L"Windows.Graphics.Capture.GraphicsCaptureSession") &&
8
-          winrt::Windows::Graphics::Capture::GraphicsCaptureSession::
9
-              IsSupported();
10
+try {
11
+   /* no contract for IGraphicsCaptureItemInterop, verify 10.0.18362.0 */
12
+   return winrt::Windows::Foundation::Metadata::ApiInformation::
13
+       IsApiContractPresent(L"Windows.Foundation.UniversalApiContract",
14
+                    8);
15
+} catch (winrt::hresult_error &err) {
16
+   blog(LOG_ERROR, "winrt_capture_supported (0x%08X): %ls", err.to_abi(),
17
+        err.message().c_str());
18
+   return false;
19
 }
20
 
21
 extern "C" EXPORT BOOL winrt_capture_cursor_toggle_supported()
22
-{
23
+try {
24
 #ifdef NTDDI_WIN10_VB
25
    return winrt::Windows::Foundation::Metadata::ApiInformation::
26
        IsPropertyPresent(
27
@@ -30,6 +34,10 @@
28
 #else
29
    return false;
30
 #endif
31
+} catch (winrt::hresult_error &err) {
32
+   blog(LOG_ERROR, "winrt_capture_cursor_toggle_supported (0x%08X): %ls",
33
+        err.to_abi(), err.message().c_str());
34
+   return false;
35
 }
36
 
37
 template<typename T>
38
@@ -125,7 +133,7 @@
39
        if (!GetCursorInfo(&ci))
40
            return;
41
 
42
-       if (!ci.flags & CURSOR_SHOWING)
43
+       if (!(ci.flags & CURSOR_SHOWING))
44
            return;
45
 
46
        HICON icon = CopyIcon(ci.hCursor);
47
@@ -311,18 +319,14 @@
48
 thread_local bool initialized_tls;
49
 
50
 extern "C" EXPORT struct winrt_capture *
51
-winrt_capture_init(BOOL cursor, HWND window, BOOL client_area, char **error,
52
-          HRESULT *hr_out)
53
+winrt_capture_init(BOOL cursor, HWND window, BOOL client_area)
54
 try {
55
    ID3D11Device *const d3d_device = (ID3D11Device *)gs_get_device_obj();
56
    ComPtr<IDXGIDevice> dxgi_device;
57
 
58
-   *error = nullptr;
59
-
60
    HRESULT hr = d3d_device->QueryInterface(&dxgi_device);
61
    if (FAILED(hr)) {
62
-       *error = bstrdup("Failed to get DXGI device");
63
-       *hr_out = hr;
64
+       blog(LOG_ERROR, "Failed to get DXGI device");
65
        return nullptr;
66
    }
67
 
68
@@ -330,8 +334,7 @@
69
    hr = CreateDirect3D11DeviceFromDXGIDevice(dxgi_device.Get(),
70
                          inspectable.put());
71
    if (FAILED(hr)) {
72
-       *error = bstrdup("Failed to get WinRT device");
73
-       *hr_out = hr;
74
+       blog(LOG_ERROR, "Failed to get WinRT device");
75
        return nullptr;
76
    }
77
 
78
@@ -347,8 +350,8 @@
79
                           IGraphicsCaptureItem>(),
80
            reinterpret_cast<void **>(winrt::put_abi(item)));
81
    } catch (winrt::hresult_error &err) {
82
-       *error = bstrdup("CreateForWindow failed");
83
-       *hr_out = err.code();
84
+       blog(LOG_ERROR, "CreateForWindow (0x%08X): %ls", err.to_abi(),
85
+            err.message().c_str());
86
        return nullptr;
87
    }
88
 
89
@@ -404,8 +407,8 @@
90
    return capture;
91
 
92
 } catch (winrt::hresult_error &err) {
93
-   *error = bstrdup("oh wow something else in winrt_capture_init failed");
94
-   *hr_out = err.code();
95
+   blog(LOG_ERROR, "winrt_capture_init (0x%08X): %ls", err.to_abi(),
96
+        err.message().c_str());
97
    return nullptr;
98
 }
99
 
100
obs-studio-25.0.0.tar.xz/libobs-winrt/winrt-capture.h -> obs-studio-25.0.1.tar.xz/libobs-winrt/winrt-capture.h Changed
11
 
1
@@ -12,8 +12,7 @@
2
 EXPORT BOOL winrt_capture_supported();
3
 EXPORT BOOL winrt_capture_cursor_toggle_supported();
4
 EXPORT struct winrt_capture *winrt_capture_init(BOOL cursor, HWND window,
5
-                       BOOL client_area, char **error,
6
-                       HRESULT *hr);
7
+                       BOOL client_area);
8
 EXPORT void winrt_capture_free(struct winrt_capture *capture);
9
 
10
 EXPORT void winrt_capture_show_cursor(struct winrt_capture *capture,
11
obs-studio-25.0.0.tar.xz/libobs/graphics/graphics.h -> obs-studio-25.0.1.tar.xz/libobs/graphics/graphics.h Changed
10
 
1
@@ -181,8 +181,6 @@
2
    long y;
3
    long cx;
4
    long cy;
5
-   char *monitor_name;
6
-   uint32_t flags;
7
 };
8
 
9
 struct gs_tvertarray {
10
obs-studio-25.0.0.tar.xz/libobs/obs-config.h -> obs-studio-25.0.1.tar.xz/libobs/obs-config.h Changed
10
 
1
@@ -41,7 +41,7 @@
2
  *
3
  * Reset to zero each major or minor version
4
  */
5
-#define LIBOBS_API_PATCH_VER 0
6
+#define LIBOBS_API_PATCH_VER 1
7
 
8
 #define MAKE_SEMANTIC_VERSION(major, minor, patch) \
9
    ((major << 24) | (minor << 16) | patch)
10
obs-studio-25.0.0.tar.xz/plugins/obs-browser/browser-client.cpp -> obs-studio-25.0.1.tar.xz/plugins/obs-browser/browser-client.cpp Changed
11
 
1
@@ -162,7 +162,8 @@
2
 #endif
3
    }
4
 
5
-   rect.Set(0, 0, bs->width, bs->height);
6
+   rect.Set(0, 0, bs->width < 1 ? 1 : bs->width,
7
+        bs->height < 1 ? 1 : bs->height);
8
 #if CHROME_VERSION_BUILD >= 3578
9
    return;
10
 #else
11
obs-studio-25.0.0.tar.xz/plugins/obs-browser/browser-version.h -> obs-studio-25.0.1.tar.xz/plugins/obs-browser/browser-version.h Changed
10
 
1
@@ -2,7 +2,7 @@
2
 
3
 #define OBS_BROWSER_VERSION_MAJOR 2
4
 #define OBS_BROWSER_VERSION_MINOR 8
5
-#define OBS_BROWSER_VERSION_PATCH 5
6
+#define OBS_BROWSER_VERSION_PATCH 6
7
 
8
 #ifndef MAKE_SEMANTIC_VERSION
9
 #define MAKE_SEMANTIC_VERSION(major, minor, patch) \
10
obs-studio-25.0.0.tar.xz/plugins/obs-browser/obs-browser-source.cpp -> obs-studio-25.0.1.tar.xz/plugins/obs-browser/obs-browser-source.cpp Changed
15
 
1
@@ -428,7 +428,12 @@
2
            n_url = CefURIEncode(n_url, false);
3
 
4
 #ifdef _WIN32
5
-           n_url.replace(n_url.find("%3A"), 3, ":");
6
+           size_t slash = n_url.find("%2F");
7
+           size_t colon = n_url.find("%3A");
8
+
9
+           if (slash != std::string::npos &&
10
+               colon != std::string::npos && colon < slash)
11
+               n_url.replace(colon, 3, ":");
12
 #endif
13
 
14
            while (n_url.find("%5C") != std::string::npos)
15
obs-studio-25.0.0.tar.xz/plugins/obs-ffmpeg/obs-ffmpeg-nvenc.c -> obs-studio-25.0.1.tar.xz/plugins/obs-ffmpeg/obs-ffmpeg-nvenc.c Changed
11
 
1
@@ -570,5 +570,9 @@
2
    .get_extra_data = nvenc_extra_data,
3
    .get_sei_data = nvenc_sei_data,
4
    .get_video_info = nvenc_video_info,
5
+#ifdef _WIN32
6
    .caps = OBS_ENCODER_CAP_DYN_BITRATE | OBS_ENCODER_CAP_INTERNAL,
7
+#else
8
+   .caps = OBS_ENCODER_CAP_DYN_BITRATE,
9
+#endif
10
 };
11
obs-studio-25.0.0.tar.xz/plugins/win-capture/duplicator-monitor-capture.c -> obs-studio-25.0.1.tar.xz/plugins/win-capture/duplicator-monitor-capture.c Changed
36
 
1
@@ -273,32 +273,13 @@
2
    if (!gs_get_duplicator_monitor_info(monitor_idx, &info))
3
        return false;
4
 
5
-   struct dstr format_str = {0};
6
-   dstr_copy(&format_str, "%s: %ldx%ld @ %ld,%ld");
7
-
8
-   struct dstr m = {0};
9
-   dstr_copy(&m, info.monitor_name);
10
-   if (dstr_is_empty(&m)) {
11
-       // Fallback
12
-       struct dstr d = {0};
13
-       dstr_catf(&d, "%s %d", TEXT_MONITOR, monitor_idx + 1);
14
-       dstr_free(&m);
15
-       dstr_copy_dstr(&m, &d);
16
-       dstr_free(&d);
17
-   }
18
-
19
-   if (info.flags & MONITORINFOF_PRIMARY)
20
-       dstr_catf(&format_str, " (%s)", TEXT_PRIMARY_MONITOR);
21
-
22
-   dstr_catf(&monitor_desc, format_str.array, m.array, info.cx, info.cy,
23
-         info.x, info.y);
24
+   dstr_catf(&monitor_desc, "%s %d: %ldx%ld @ %ld,%ld", TEXT_MONITOR,
25
+         monitor_idx + 1, info.cx, info.cy, info.x, info.y);
26
 
27
    obs_property_list_add_int(monitor_list, monitor_desc.array,
28
                  monitor_idx);
29
 
30
    dstr_free(&monitor_desc);
31
-   dstr_free(&format_str);
32
-   dstr_free(&m);
33
 
34
    return true;
35
 }
36
obs-studio-25.0.0.tar.xz/plugins/win-capture/game-capture.c -> obs-studio-25.0.1.tar.xz/plugins/win-capture/game-capture.c Changed
16
 
1
@@ -1265,10 +1265,12 @@
2
 
3
    DWORD error = 0;
4
    if (!init_data_map(gc, gc->window)) {
5
+       HWND retry_hwnd = (HWND)(uintptr_t)gc->global_hook_info->window;
6
        error = GetLastError();
7
 
8
-       /* if there's an error, try with 0 (for UWP programs) */
9
-       if (init_data_map(gc, NULL)) {
10
+       /* if there's an error, just override.  some windows don't play
11
+        * nice. */
12
+       if (init_data_map(gc, retry_hwnd)) {
13
            error = 0;
14
        }
15
    }
16
obs-studio-25.0.0.tar.xz/plugins/win-capture/monitor-capture.c -> obs-studio-25.0.1.tar.xz/plugins/win-capture/monitor-capture.c Changed
69
 
1
@@ -1,5 +1,4 @@
2
 #include <util/dstr.h>
3
-#include <util/platform.h>
4
 #include "dc-capture.h"
5
 
6
 /* clang-format off */
7
@@ -177,7 +176,7 @@
8
    UNUSED_PARAMETER(rect);
9
 
10
    obs_property_t *monitor_list = (obs_property_t *)param;
11
-   MONITORINFOEX mi;
12
+   MONITORINFO mi;
13
    size_t monitor_id = 0;
14
    struct dstr monitor_desc = {0};
15
    struct dstr resolution = {0};
16
@@ -188,40 +187,18 @@
17
    mi.cbSize = sizeof(mi);
18
    GetMonitorInfo(handle, &mi);
19
 
20
-   DISPLAY_DEVICE ddev;
21
-   ddev.cb = sizeof(ddev);
22
-   EnumDisplayDevices(mi.szDevice, 0, &ddev, 1);
23
-
24
-   char *devname = NULL;
25
-#ifdef UNICODE
26
-   os_wcs_to_utf8_ptr(ddev.DeviceString, 128, &devname);
27
-#else
28
-   devname = (char *)bstrdup(ddev.DeviceString);
29
-#endif
30
-
31
    dstr_catf(&resolution, "%dx%d @ %d,%d",
32
          mi.rcMonitor.right - mi.rcMonitor.left,
33
          mi.rcMonitor.bottom - mi.rcMonitor.top, mi.rcMonitor.left,
34
          mi.rcMonitor.top);
35
 
36
-   dstr_copy(&format_string, "%s: %s");
37
+   dstr_copy(&format_string, "%s %d: %s");
38
    if (mi.dwFlags == MONITORINFOF_PRIMARY) {
39
        dstr_catf(&format_string, " (%s)", TEXT_PRIMARY_MONITOR);
40
    }
41
 
42
-   struct dstr m = {0};
43
-   dstr_copy(&m, devname);
44
-   dstr_replace(&m, "(", " (");
45
-   if (dstr_is_empty(&m)) {
46
-       struct dstr d = {0};
47
-       dstr_catf(&d, "%s %d", TEXT_MONITOR, monitor_id + 1);
48
-       dstr_free(&m);
49
-       dstr_copy_dstr(&m, &d);
50
-       dstr_free(&d);
51
-   }
52
-
53
-   dstr_catf(&monitor_desc, format_string.array, m.array,
54
-         resolution.array);
55
+   dstr_catf(&monitor_desc, format_string.array, TEXT_MONITOR,
56
+         monitor_id + 1, resolution.array);
57
 
58
    obs_property_list_add_int(monitor_list, monitor_desc.array,
59
                  (int)monitor_id);
60
@@ -229,8 +206,6 @@
61
    dstr_free(&monitor_desc);
62
    dstr_free(&resolution);
63
    dstr_free(&format_string);
64
-   dstr_free(&m);
65
-   bfree(devname);
66
 
67
    return TRUE;
68
 }
69
obs-studio-25.0.0.tar.xz/plugins/win-capture/window-capture.c -> obs-studio-25.0.1.tar.xz/plugins/win-capture/window-capture.c Changed
54
 
1
@@ -29,8 +29,7 @@
2
    BOOL *(*winrt_capture_supported)();
3
    BOOL *(*winrt_capture_cursor_toggle_supported)();
4
    struct winrt_capture *(*winrt_capture_init)(BOOL cursor, HWND window,
5
-                           BOOL client_area,
6
-                           char **error, HRESULT *hr);
7
+                           BOOL client_area);
8
    void (*winrt_capture_free)(struct winrt_capture *capture);
9
    void (*winrt_capture_show_cursor)(struct winrt_capture *capture,
10
                      BOOL visible);
11
@@ -247,6 +246,8 @@
12
    /* forces a reset */
13
    wc->window = NULL;
14
    wc->check_window_timer = WC_CHECK_TIMER;
15
+
16
+   wc->previously_failed = false;
17
 }
18
 
19
 static uint32_t wc_width(void *data)
20
@@ -480,24 +481,16 @@
21
        dc_capture_capture(&wc->capture, wc->window);
22
    } else if (wc->method == METHOD_WGC) {
23
        if (wc->window && (wc->capture_winrt == NULL)) {
24
-           char *error = NULL;
25
-           HRESULT hr;
26
-
27
-           wc->capture_winrt = wc->exports.winrt_capture_init(
28
-               wc->cursor, wc->window, wc->client_area, &error,
29
-               &hr);
30
-
31
-           if (!wc->capture_winrt && !wc->previously_failed) {
32
-               blog(LOG_WARNING,
33
-                    "%s: winrt_capture_init failed: %s: %lX",
34
-                    obs_source_get_name(wc->source), error,
35
-                    hr);
36
-               wc->previously_failed = true;
37
-           } else if (wc->capture_winrt) {
38
-               wc->previously_failed = false;
39
+           if (!wc->previously_failed) {
40
+               wc->capture_winrt =
41
+                   wc->exports.winrt_capture_init(
42
+                       wc->cursor, wc->window,
43
+                       wc->client_area);
44
+
45
+               if (!wc->capture_winrt) {
46
+                   wc->previously_failed = true;
47
+               }
48
            }
49
-
50
-           bfree(error);
51
        }
52
    }
53
 
54