reverted triple buffering code that was causing crashes

master
jp9000 2013-03-08 23:29:43 -07:00
parent e8fd9340f4
commit 0d1157ff4e
7 changed files with 34 additions and 49 deletions

32
OBS.rc
View File

@ -338,7 +338,7 @@ BEGIN
RTEXT "Settings.Advanced.SceneBufferTime",IDC_STATIC,7,47,168,8
EDITTEXT IDC_SCENEBUFFERTIME_EDIT,177,44,40,14,ES_AUTOHSCROLL | ES_NUMBER
CONTROL "",IDC_SCENEBUFFERTIME,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,218,44,10,14
GROUPBOX "Settings.Video",IDC_STATIC,4,67,418,98
GROUPBOX "Settings.Video",IDC_STATIC,4,67,418,88
RTEXT "Settings.Advanced.VideoEncoderCPUTradeoff",IDC_STATIC,5,79,168,8
COMBOBOX IDC_PRESET,177,77,82,62,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Settings.Advanced.UseCFR",IDC_USECFR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,93,292,10
@ -347,25 +347,23 @@ BEGIN
EDITTEXT IDC_VIDEOENCODERSETTINGS,33,119,373,14,ES_AUTOHSCROLL
CONTROL "Settings.Advanced.UnlockHigherFPS",IDC_UNLOCKHIGHFPS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,138,217,10
GROUPBOX "Settings.Audio",IDC_STATIC,4,167,418,73
GROUPBOX "Settings.Audio",IDC_STATIC,4,159,418,73
CONTROL "Settings.Advanced.UseHighQualityResampling",IDC_USEHIGHQUALITYRESAMPLING,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,180,332,10
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,172,332,10
CONTROL "Settings.Advanced.SyncToVideoTime",IDC_SYNCTOVIDEOTIME,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,194,332,10
LTEXT "Settings.Advanced.GlobalAudioTimeAdjust",IDC_STATIC,5,209,168,8,0,WS_EX_RIGHT
EDITTEXT IDC_AUDIOTIMEADJUST_EDIT,176,206,40,14,ES_AUTOHSCROLL | WS_DISABLED
CONTROL "",IDC_AUDIOTIMEADJUST,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_DISABLED,216,206,10,14
GROUPBOX "Settings.Advanced.Network",IDC_STATIC,4,246,418,60
RTEXT "Settings.Advanced.BindToIP",IDC_STATIC,5,259,168,8
COMBOBOX IDC_BINDIP,177,257,87,62,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Settings.Info",IDC_INFO,7,311,418,24,NOT WS_VISIBLE
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,186,332,10
LTEXT "Settings.Advanced.GlobalAudioTimeAdjust",IDC_STATIC,5,201,168,8,0,WS_EX_RIGHT
EDITTEXT IDC_AUDIOTIMEADJUST_EDIT,176,198,40,14,ES_AUTOHSCROLL | WS_DISABLED
CONTROL "",IDC_AUDIOTIMEADJUST,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_DISABLED,216,198,10,14
GROUPBOX "Settings.Advanced.Network",IDC_STATIC,4,238,418,60
RTEXT "Settings.Advanced.BindToIP",IDC_STATIC,5,251,168,8
COMBOBOX IDC_BINDIP,177,249,87,62,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Settings.Info",IDC_INFO,7,303,418,24,NOT WS_VISIBLE
CONTROL "Settings.Advanced.AutomaticLatency",IDC_LATENCYMETHOD,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,274,169,10,WS_EX_RIGHT
RTEXT "Settings.Advanced.LatencyTuning",IDC_STATIC,5,289,168,8
EDITTEXT IDC_LATENCYTUNE,178,286,40,14,ES_AUTOHSCROLL | ES_NUMBER
CONTROL "Settings.Advanced.UseTripleBuffering",IDC_USETRIPLEBUFFERING,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,151,217,10
CONTROL "Settings.Audio.UseMicQPC",IDC_USEMICQPC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,223,332,10
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,266,169,10,WS_EX_RIGHT
RTEXT "Settings.Advanced.LatencyTuning",IDC_STATIC,5,281,168,8
EDITTEXT IDC_LATENCYTUNE,178,278,40,14,ES_AUTOHSCROLL | ES_NUMBER
CONTROL "Settings.Audio.UseMicQPC",IDC_USEMICQPC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,215,332,10
END
IDD_CONFIGURETRANSITIONSOURCE DIALOGEX 0, 0, 338, 216

View File

@ -71,7 +71,7 @@ extern TCHAR lpAppPath[MAX_PATH];
extern TCHAR lpAppDataPath[MAX_PATH];
#define OBS_VERSION 0x000472
#define OBS_VERSION_STRING_ANSI "Open Broadcaster Software v0.473b (test build 9)"
#define OBS_VERSION_STRING_ANSI "Open Broadcaster Software v0.473b (glorious test build 10)"
#define OBS_VERSION_STRING TEXT(OBS_VERSION_STRING_ANSI)
#define OBS_TEST_BUILD 1 //define this if releasing a test build to disable the auto updater

View File

@ -21,7 +21,7 @@
class Scene;
#define RENDER_BUFFER_ARRAY_NUM 3
#define NUM_RENDER_BUFFERS 2
static const int minClientWidth = 700;
static const int minClientHeight = 200;
@ -397,11 +397,9 @@ class OBS
//---------------------------------------------------
// graphics stuff
UINT numRenderBuffers;
ID3D10Texture2D *copyTextures[RENDER_BUFFER_ARRAY_NUM];
Texture *mainRenderTextures[RENDER_BUFFER_ARRAY_NUM];
Texture *yuvRenderTextures[RENDER_BUFFER_ARRAY_NUM];
ID3D10Texture2D *copyTextures[NUM_RENDER_BUFFERS];
Texture *mainRenderTextures[NUM_RENDER_BUFFERS];
Texture *yuvRenderTextures[NUM_RENDER_BUFFERS];
Texture *transitionTexture;
bool bTransitioning;

View File

@ -131,9 +131,6 @@ void OBS::Start()
//-------------------------------------------------------------
bufferingTime = GlobalConfig->GetInt(TEXT("General"), TEXT("SceneBufferingTime"), 400);
numRenderBuffers = GlobalConfig->GetInt(TEXT("General"), TEXT("UseTripleBuffering"), FALSE) ? 2 : 3;
int monitorID = AppConfig->GetInt(TEXT("Video"), TEXT("Monitor"));
if(monitorID >= (int)monitors.Num())
monitorID = 0;
@ -202,7 +199,7 @@ void OBS::Start()
//-------------------------------------------------------------
for(UINT i=0; i<numRenderBuffers; i++)
for(UINT i=0; i<NUM_RENDER_BUFFERS; i++)
{
mainRenderTextures[i] = CreateRenderTarget(baseCX, baseCY, GS_BGRA, FALSE);
yuvRenderTextures[i] = CreateRenderTarget(outputCX, outputCY, GS_BGRA, FALSE);
@ -222,7 +219,7 @@ void OBS::Start()
td.Usage = D3D10_USAGE_STAGING;
td.CPUAccessFlags = D3D10_CPU_ACCESS_READ;
for(UINT i=0; i<numRenderBuffers; i++)
for(UINT i=0; i<NUM_RENDER_BUFFERS; i++)
{
HRESULT err = GetD3D()->CreateTexture2D(&td, NULL, &copyTextures[i]);
if(FAILED(err))
@ -406,6 +403,10 @@ void OBS::Start()
//-------------------------------------------------------------
bufferingTime = GlobalConfig->GetInt(TEXT("General"), TEXT("SceneBufferingTime"), 400);
//-------------------------------------------------------------
bForceMicMono = AppConfig->GetInt(TEXT("Audio"), TEXT("ForceMicMono")) != 0;
bRecievedFirstAudioFrame = false;
@ -568,7 +569,7 @@ void OBS::Stop()
//-------------------------------------------------------------
for(UINT i=0; i<numRenderBuffers; i++)
for(UINT i=0; i<NUM_RENDER_BUFFERS; i++)
{
delete mainRenderTextures[i];
delete yuvRenderTextures[i];
@ -577,7 +578,7 @@ void OBS::Stop()
yuvRenderTextures[i] = NULL;
}
for(UINT i=0; i<numRenderBuffers; i++)
for(UINT i=0; i<NUM_RENDER_BUFFERS; i++)
{
SafeRelease(copyTextures[i]);
}

View File

@ -241,7 +241,7 @@ void STDCALL SleepTo(LONGLONG clockFreq, QWORD qw100NSTime)
void OBS::MainCaptureLoop()
{
int curRenderTarget = 0, curYUVTexture = 0, curCopyTexture = 0;
int copyWait = numRenderBuffers-1;
int copyWait = NUM_RENDER_BUFFERS-1;
bSentHeaders = false;
bFirstAudioPacket = true;
@ -696,7 +696,7 @@ void OBS::MainCaptureLoop()
if(!bEncode)
{
if(curYUVTexture == (numRenderBuffers-1))
if(curYUVTexture == (NUM_RENDER_BUFFERS-1))
curYUVTexture = 0;
else
curYUVTexture++;
@ -707,7 +707,7 @@ void OBS::MainCaptureLoop()
{
curStreamTime = qwTime-firstFrameTime;
UINT prevCopyTexture = (curCopyTexture == 0) ? numRenderBuffers-1 : curCopyTexture-1;
UINT prevCopyTexture = (curCopyTexture == 0) ? NUM_RENDER_BUFFERS-1 : curCopyTexture-1;
ID3D10Texture2D *copyTexture = copyTextures[curCopyTexture];
profileIn("CopyResource");
@ -841,12 +841,12 @@ void OBS::MainCaptureLoop()
}
}
if(curCopyTexture == (numRenderBuffers-1))
if(curCopyTexture == (NUM_RENDER_BUFFERS-1))
curCopyTexture = 0;
else
curCopyTexture++;
if(curYUVTexture == (numRenderBuffers-1))
if(curYUVTexture == (NUM_RENDER_BUFFERS-1))
curYUVTexture = 0;
else
curYUVTexture++;
@ -854,7 +854,7 @@ void OBS::MainCaptureLoop()
lastRenderTarget = curRenderTarget;
if(curRenderTarget == (numRenderBuffers-1))
if(curRenderTarget == (NUM_RENDER_BUFFERS-1))
curRenderTarget = 0;
else
curRenderTarget++;

View File

@ -1741,11 +1741,6 @@ INT_PTR CALLBACK OBS::AdvancedSettingsProc(HWND hwnd, UINT message, WPARAM wPara
//--------------------------------------------
bool bUseTripleBuffering = GlobalConfig->GetInt(TEXT("Video"), TEXT("UseTripleBuffering"), false) != 0;
SendMessage(GetDlgItem(hwnd, IDC_USETRIPLEBUFFERING), BM_SETCHECK, bUseTripleBuffering ? BST_CHECKED : BST_UNCHECKED, 0);
//------------------------------------
bool bUnlockFPS = AppConfig->GetInt(TEXT("Video"), TEXT("UnlockFPS")) != 0;
SendMessage(GetDlgItem(hwnd, IDC_UNLOCKHIGHFPS), BM_SETCHECK, bUnlockFPS ? BST_CHECKED : BST_UNCHECKED, 0);
@ -1927,7 +1922,6 @@ INT_PTR CALLBACK OBS::AdvancedSettingsProc(HWND hwnd, UINT message, WPARAM wPara
break;
case IDC_USEMICQPC:
case IDC_USETRIPLEBUFFERING:
case IDC_SYNCTOVIDEOTIME:
case IDC_USECFR:
case IDC_USEHIGHQUALITYRESAMPLING:
@ -2292,11 +2286,6 @@ void OBS::ApplySettings()
//------------------------------------
bool bUseTripleBuffering = SendMessage(GetDlgItem(hwndCurrentSettings, IDC_USETRIPLEBUFFERING), BM_GETCHECK, 0, 0) == BST_CHECKED;
GlobalConfig->SetInt(TEXT("Video"), TEXT("UseTripleBuffering"), bUseTripleBuffering);
//------------------------------------
BOOL bUseHQResampling = SendMessage(GetDlgItem(hwndCurrentSettings, IDC_USEHIGHQUALITYRESAMPLING), BM_GETCHECK, 0, 0) == BST_CHECKED;
AppConfig->SetInt (TEXT("Audio"), TEXT("UseHighQualityResampling"), bUseHQResampling);

View File

@ -225,7 +225,6 @@
#define IDC_ITALIC 1127
#define IDC_TIMELEFT 1127
#define IDC_UNLOCKHIGHFPS 1128
#define IDC_USETRIPLEBUFFERING 1129
#define IDC_CANCEL 1130
#define IDC_PRIORITY 1132
#define IDC_USECBR 1133