-
Notifications
You must be signed in to change notification settings - Fork 103
/
Copy pathwebrtc_win.patch
executable file
·47 lines (44 loc) · 1.85 KB
/
webrtc_win.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
webrtc/base/win32window.cc | 14 +++++++++++---
webrtc/modules/video_capture/windows/video_capture_ds.cc | 3 ++-
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/webrtc/base/win32window.cc b/webrtc/base/win32window.cc
index 4d41014..715f181 100644
--- a/webrtc/base/win32window.cc
+++ b/webrtc/base/win32window.cc
@@ -53,13 +53,21 @@ bool Win32Window::Create(HWND parent, const wchar_t* title, DWORD style,
wcex.lpfnWndProc = &Win32Window::WndProc;
wcex.lpszClassName = kWindowBaseClassName;
window_class_ = ::RegisterClassEx(&wcex);
- if (!window_class_) {
- LOG_GLE(LS_ERROR) << "RegisterClassEx failed";
- return false;
+ if (!window_class_) {
+ if (GetLastError() == ERROR_CLASS_ALREADY_EXISTS) {
+ LOG_GLE(LS_WARNING) << "RegisterClassEx failed: ERROR_CLASS_ALREADY_EXISTS";
+ }
+ else {
+ LOG_GLE(LS_ERROR) << "RegisterClassEx failed";
+ return false;
+ }
}
}
wnd_ = ::CreateWindowEx(exstyle, kWindowBaseClassName, title, style,
x, y, cx, cy, parent, NULL, instance_, this);
+ if (wnd_ && !window_class_) {
+ window_class_ = GetClassWord(wnd_, GCW_ATOM);
+ }
return (NULL != wnd_);
}
diff --git a/webrtc/modules/video_capture/windows/video_capture_ds.cc b/webrtc/modules/video_capture/windows/video_capture_ds.cc
index 2d66055..0bbb7dc 100644
--- a/webrtc/modules/video_capture/windows/video_capture_ds.cc
+++ b/webrtc/modules/video_capture/windows/video_capture_ds.cc
@@ -178,7 +178,8 @@ int32_t VideoCaptureDS::StopCapture()
{
CriticalSectionScoped cs(&_apiCs);
- HRESULT hr = _mediaControl->Pause();
+ // TODO(dmi) https://code.google.com/p/webrtc/issues/detail?id=1649
+ HRESULT hr = _mediaControl->Stop()/*_mediaControl->Pause()*/;
if (FAILED(hr))
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id,