Skip to content

Commit

Permalink
Revert "UI: Always create a display capture on first run"
Browse files Browse the repository at this point in the history
This reverts commit 35b2ce5.

There is far too much potential for issues to occur if the first-time
start creates a display capture by default on linux and windows.
Display capture on windows laptops will not be guaranteed to capture
properly, leaving the user with a blank screen.  Display capture on
linux downloads its image off the graphics processor, so it's quite
inefficient to have on by default.
  • Loading branch information
jp9000 committed Sep 23, 2015
1 parent 9630c30 commit ecb8c2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 24 deletions.
25 changes: 2 additions & 23 deletions obs/window-basic-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,31 +350,10 @@ static inline bool HasAudioDevices(const char *source_id)
return count != 0;
}

void OBSBasic::CreateFirstRunSources(obs_scene_t *scene)
void OBSBasic::CreateFirstRunSources()
{
bool hasDesktopAudio = HasAudioDevices(App()->OutputAudioSource());
bool hasInputAudio = HasAudioDevices(App()->InputAudioSource());
const char *displayCaptureType = nullptr;
obs_source_t *source = nullptr;

#ifdef __APPLE__
displayCaptureType = "display_capture";
#elif _WIN32
if (GetWindowsVersion() >= 0x602)
displayCaptureType = "monitor_capture";
#else //X11
displayCaptureType = "xshm_input";
#endif
if (displayCaptureType) {
source = obs_source_create(OBS_SOURCE_TYPE_INPUT,
displayCaptureType, Str("Basic.DisplayCapture"),
NULL, nullptr);
}
if (source) {
obs_scene_add(scene, source);
obs_add_source(source);
obs_source_release(source);
}

if (hasDesktopAudio)
ResetAudioDevice(App()->OutputAudioSource(), "default",
Expand All @@ -396,7 +375,7 @@ void OBSBasic::CreateDefaultScene(bool firstStart)
obs_add_source(source);

if (firstStart)
CreateFirstRunSources(scene);
CreateFirstRunSources();

obs_set_output_source(0, obs_scene_get_source(scene));
obs_scene_release(scene);
Expand Down
2 changes: 1 addition & 1 deletion obs/window-basic-main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class OBSBasic : public OBSMainWindow {

void SetupEncoders();

void CreateFirstRunSources(obs_scene_t *scene);
void CreateFirstRunSources();
void CreateDefaultScene(bool firstStart);

void ClearVolumeControls();
Expand Down

0 comments on commit ecb8c2c

Please sign in to comment.