Some small code cleanups via static analysis (cppcheck)
parent
1da99309bd
commit
9aceaadbcc
|
@ -34,10 +34,10 @@ void WINAPI FreeMediaType(AM_MEDIA_TYPE& mt)
|
|||
|
||||
HRESULT WINAPI CopyMediaType(AM_MEDIA_TYPE *pmtTarget, const AM_MEDIA_TYPE *pmtSource)
|
||||
{
|
||||
*pmtTarget = *pmtSource;
|
||||
|
||||
if(!pmtSource || !pmtTarget) return S_FALSE;
|
||||
|
||||
*pmtTarget = *pmtSource;
|
||||
|
||||
if(pmtSource->cbFormat && pmtSource->pbFormat)
|
||||
{
|
||||
pmtTarget->pbFormat = (PBYTE)CoTaskMemAlloc(pmtSource->cbFormat);
|
||||
|
@ -195,7 +195,7 @@ bool GetVideoOutputTypes(const List<MediaOutputInfo> &outputList, UINT width, UI
|
|||
for(UINT i=0; i<outputList.Num(); i++)
|
||||
{
|
||||
MediaOutputInfo &outputInfo = outputList[i];
|
||||
VIDEOINFOHEADER *pVih = reinterpret_cast<VIDEOINFOHEADER*>(outputInfo.mediaType->pbFormat);
|
||||
//VIDEOINFOHEADER *pVih = reinterpret_cast<VIDEOINFOHEADER*>(outputInfo.mediaType->pbFormat);
|
||||
|
||||
if( outputInfo.minCX <= width && outputInfo.maxCX >= width &&
|
||||
outputInfo.minCY <= height && outputInfo.maxCY >= height &&
|
||||
|
@ -223,7 +223,7 @@ MediaOutputInfo* GetBestMediaOutput(const List<MediaOutputInfo> &outputList, UIN
|
|||
for(UINT i=0; i<outputList.Num(); i++)
|
||||
{
|
||||
MediaOutputInfo &outputInfo = outputList[i];
|
||||
VIDEOINFOHEADER *pVih = reinterpret_cast<VIDEOINFOHEADER*>(outputInfo.mediaType->pbFormat);
|
||||
//VIDEOINFOHEADER *pVih = reinterpret_cast<VIDEOINFOHEADER*>(outputInfo.mediaType->pbFormat);
|
||||
|
||||
if( outputInfo.minCX <= width && outputInfo.maxCX >= width &&
|
||||
outputInfo.minCY <= height && outputInfo.maxCY >= height)
|
||||
|
|
|
@ -118,6 +118,7 @@ struct VBData
|
|||
|
||||
if(s.IsLoading())
|
||||
{
|
||||
//FIXME: ???
|
||||
s << dwSize;
|
||||
UVList.SetSize(dwSize);
|
||||
}
|
||||
|
|
|
@ -145,13 +145,13 @@ BOOL bProfilingEnabled = FALSE;
|
|||
HANDLE hProfilerTimer = NULL;
|
||||
|
||||
|
||||
void STDCALL EnableProfiling(BOOL bEnable, float minPercentage, float minTime)
|
||||
void STDCALL EnableProfiling(BOOL bEnable, float pminPercentage, float pminTime)
|
||||
{
|
||||
//if(engine && !engine->InEditor())
|
||||
bProfilingEnabled = bEnable;
|
||||
|
||||
minPercentage = minPercentage;
|
||||
minTime = minTime;
|
||||
minPercentage = pminPercentage;
|
||||
minTime = pminTime;
|
||||
}
|
||||
|
||||
void STDCALL DumpProfileData()
|
||||
|
|
|
@ -448,6 +448,7 @@ public:
|
|||
{
|
||||
if(s.IsLoading())
|
||||
{
|
||||
//FIXME: ???
|
||||
UINT num;
|
||||
s << num;
|
||||
list.SetSize(num);
|
||||
|
|
|
@ -143,6 +143,8 @@ public:
|
|||
ret = file.SetPos(INT64(GetPos())+offset, XFILE_BEGIN);
|
||||
else if(seekType == SERIALIZE_SEEK_END)
|
||||
ret = file.SetPos(offset, XFILE_END);
|
||||
else
|
||||
return 0;
|
||||
|
||||
Cache();
|
||||
|
||||
|
|
|
@ -334,8 +334,6 @@ String& String::operator+=(const String &str)
|
|||
lpString = (TSTR)Allocate((curLength+1)*sizeof(TCHAR));
|
||||
scpy(lpString, str.lpString);
|
||||
}
|
||||
|
||||
int strlenthingy = slen(lpString);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -661,7 +659,6 @@ String String::GetToken(int id, TCHAR token) const
|
|||
void String::GetTokenList(StringList &strList, TCHAR token, BOOL bIncludeEmpty) const
|
||||
{
|
||||
TSTR lpTemp = lpString;
|
||||
UINT curTokenID = 0;
|
||||
|
||||
do
|
||||
{
|
||||
|
@ -976,6 +973,7 @@ Serializer& operator<<(Serializer &s, String &str)
|
|||
{
|
||||
if(s.IsLoading())
|
||||
{
|
||||
//FIXME: ???
|
||||
UINT utf8Length;
|
||||
|
||||
s << utf8Length;
|
||||
|
@ -1011,7 +1009,6 @@ BOOL STDCALL ValidFloatString(CTSTR lpStr)
|
|||
|
||||
BOOL bFoundDecimal = FALSE;
|
||||
BOOL bFoundExp = FALSE;
|
||||
BOOL bFoundEndThingy = FALSE;
|
||||
|
||||
if((*lpStr == '-') || (*lpStr == '+'))
|
||||
++lpStr;
|
||||
|
@ -1053,7 +1050,6 @@ BOOL STDCALL ValidFloatString(CTSTR lpStr)
|
|||
if(*++lpStr != 0)
|
||||
return FALSE;
|
||||
|
||||
bFoundEndThingy = TRUE;
|
||||
break;
|
||||
}
|
||||
else if((*lpStr > '9') || (*lpStr < '0'))
|
||||
|
|
|
@ -544,6 +544,7 @@ public:
|
|||
{
|
||||
if(s.IsLoading())
|
||||
{
|
||||
//FIXME: ???
|
||||
UINT num;
|
||||
s << num;
|
||||
list.SetSize(num);
|
||||
|
|
|
@ -117,15 +117,16 @@ LRESULT CALLBACK VolumeMeterProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
|||
{
|
||||
meter = GetVolumeMeterData(hwnd);
|
||||
|
||||
DeleteObject(meter->hRed);
|
||||
DeleteObject(meter->hGreen);
|
||||
DeleteObject(meter->hGreenDark);
|
||||
DeleteObject(meter->hBlack);
|
||||
DeleteObject(meter->hGray);
|
||||
DeleteObject(meter->hLightGray);
|
||||
|
||||
if(meter)
|
||||
{
|
||||
DeleteObject(meter->hRed);
|
||||
DeleteObject(meter->hGreen);
|
||||
DeleteObject(meter->hGreenDark);
|
||||
DeleteObject(meter->hBlack);
|
||||
DeleteObject(meter->hGray);
|
||||
DeleteObject(meter->hLightGray);
|
||||
free(meter);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -581,6 +581,7 @@ UINT OBSAPIInterface::CreateHotkey(DWORD hotkey, OBSHOTKEYPROC hotkeyProc, UPARA
|
|||
if(!hotkey)
|
||||
return 0;
|
||||
|
||||
//FIXME: vk and fsModifiers aren't used?
|
||||
DWORD vk = LOBYTE(hotkey);
|
||||
DWORD modifier = HIBYTE(hotkey);
|
||||
DWORD fsModifiers = 0;
|
||||
|
|
|
@ -513,11 +513,11 @@ bool STDCALL ConfigureBitmapTransitionSource(XElement *element, bool bCreating)
|
|||
configInfo.data = data;
|
||||
|
||||
return (DialogBoxParam(hinstMain, MAKEINTRESOURCE(IDD_CONFIGURETRANSITIONSOURCE), hwndMain, ConfigureBitmapTransitionProc, (LPARAM)&configInfo) == IDOK);
|
||||
{
|
||||
/*{
|
||||
element->SetInt(TEXT("cx"), configInfo.cx);
|
||||
element->SetInt(TEXT("cy"), configInfo.cy);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;*/
|
||||
}
|
||||
|
|
|
@ -266,7 +266,6 @@ BOOL CodeTokenizer::GetNextTokenEval(String &token, BOOL *bFloatOccurance, int c
|
|||
TSTR lpLastSafePos = lpTemp;
|
||||
String curVal, curToken;
|
||||
BOOL bFoundNumber = FALSE;
|
||||
BOOL bUsedBracers = FALSE;
|
||||
|
||||
if(!GetNextToken(curToken)) return FALSE;
|
||||
|
||||
|
@ -291,8 +290,6 @@ BOOL CodeTokenizer::GetNextTokenEval(String &token, BOOL *bFloatOccurance, int c
|
|||
token = TEXT("(");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bUsedBracers = TRUE;
|
||||
}
|
||||
|
||||
if(curToken == TEXT("-") && iswdigit(*lpTemp))
|
||||
|
|
|
@ -57,7 +57,7 @@ LONG CALLBACK OBSExceptionHandler (PEXCEPTION_POINTERS exceptionInfo)
|
|||
SYMBOL_INFO *symInfo;
|
||||
DWORD64 fnOffset;
|
||||
TCHAR logPath[MAX_PATH];
|
||||
TCHAR dumpPath[MAX_PATH];
|
||||
|
||||
OSVERSIONINFOEX osInfo;
|
||||
SYSTEMTIME timeInfo;
|
||||
|
||||
|
@ -76,8 +76,6 @@ LONG CALLBACK OBSExceptionHandler (PEXCEPTION_POINTERS exceptionInfo)
|
|||
DWORD64 InstructionPtr;
|
||||
DWORD imageType;
|
||||
|
||||
BOOL wantUpload = TRUE;
|
||||
|
||||
TCHAR searchPath[MAX_PATH], *p;
|
||||
|
||||
static BOOL inExceptionHandler = FALSE;
|
||||
|
@ -296,6 +294,7 @@ LONG CALLBACK OBSExceptionHandler (PEXCEPTION_POINTERS exceptionInfo)
|
|||
//generate a minidump if possible
|
||||
if (fnMiniDumpWriteDump)
|
||||
{
|
||||
TCHAR dumpPath[MAX_PATH];
|
||||
HANDLE hFile;
|
||||
|
||||
tsprintf_s (dumpPath, _countof(dumpPath)-1, TEXT("%s\\crashDumps\\OBSCrashDump%.4d-%.2d-%.2d_%d.dmp"), lpAppDataPath, timeInfo.wYear, timeInfo.wMonth, timeInfo.wDay, i);
|
||||
|
|
|
@ -231,8 +231,7 @@ BOOL ShaderProcessor::ProcessShader(CTSTR input)
|
|||
TSTR lpSavedPos = lpTemp;
|
||||
String savedToken = curToken;
|
||||
|
||||
BOOL bUniform;
|
||||
if(bUniform = (curToken == TEXT("uniform")))
|
||||
if(curToken == TEXT("uniform"))
|
||||
HandMeAToken(curToken);
|
||||
|
||||
String strType = curToken;
|
||||
|
@ -284,8 +283,6 @@ BOOL ShaderProcessor::ProcessShader(CTSTR input)
|
|||
}
|
||||
else
|
||||
{
|
||||
UINT paramID = Params.Num();
|
||||
|
||||
ShaderParam *param = Params.CreateNew();
|
||||
param->name = strName;
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
void GetDisplayDevices(DeviceOutputs &deviceList)
|
||||
{
|
||||
HRESULT err;
|
||||
UINT count = 0;
|
||||
|
||||
deviceList.ClearData();
|
||||
|
||||
|
@ -453,8 +452,6 @@ void D3D10System::LoadVertexBuffer(VertexBuffer* vb)
|
|||
{
|
||||
if(vb != curVertexBuffer)
|
||||
{
|
||||
UINT offset = 0;
|
||||
|
||||
D3D10VertexBuffer *d3dVB = static_cast<D3D10VertexBuffer*>(vb);
|
||||
if(curVertexShader)
|
||||
{
|
||||
|
|
|
@ -392,7 +392,6 @@ Texture* D3D10Texture::CreateGDITexture(unsigned int width, unsigned int height)
|
|||
td.Usage = D3D10_USAGE_DEFAULT;
|
||||
td.MiscFlags = D3D10_RESOURCE_MISC_GDI_COMPATIBLE;
|
||||
|
||||
LPBYTE lpData = NULL;
|
||||
D3D10_SUBRESOURCE_DATA srd;
|
||||
zero(&srd, sizeof(srd));
|
||||
|
||||
|
@ -509,7 +508,7 @@ void CopyPackedRGB(BYTE *lpDest, BYTE *lpSource, UINT nPixels)
|
|||
|
||||
DWORD *lpDWDest = (DWORD*)lpDest;
|
||||
DWORD *lpDWSrc = (DWORD*)lpSource;
|
||||
DWORD *lpEnd = (DWORD*)(lpSource+alignedBytes);
|
||||
|
||||
while(nDWords)
|
||||
{
|
||||
switch(curComponent)
|
||||
|
@ -557,7 +556,7 @@ void D3D10Texture::SetImage(void *lpData, GSImageFormat imageFormat, UINT pitch)
|
|||
}
|
||||
|
||||
bool bMatchingFormat = false;
|
||||
UINT pixelBytes = 0;
|
||||
UINT pixelBytes = 0; //What is this needed for?
|
||||
|
||||
switch(format)
|
||||
{
|
||||
|
@ -605,8 +604,6 @@ void D3D10Texture::SetImage(void *lpData, GSImageFormat imageFormat, UINT pitch)
|
|||
//-------------------------------------------------------------------------
|
||||
else
|
||||
{
|
||||
UINT rowWidth = width*pixelBytes;
|
||||
|
||||
if(pitch == map.RowPitch)
|
||||
{
|
||||
if(App->SSE2Available())
|
||||
|
|
|
@ -132,8 +132,6 @@ public:
|
|||
|
||||
if(duplicator)
|
||||
{
|
||||
Texture *newTex = NULL;
|
||||
|
||||
switch(duplicator->AquireNextFrame(0))
|
||||
{
|
||||
case DuplicatorInfo_Lost:
|
||||
|
@ -276,7 +274,7 @@ public:
|
|||
|
||||
bMouseCaptured = bCaptureMouse && GetCursorInfo(&ci);
|
||||
|
||||
bool bWindowMinimized = false, bWindowNotFound = false;
|
||||
bool bWindowNotFound = false;
|
||||
HWND hwndCapture = NULL;
|
||||
if(captureType == 1)
|
||||
{
|
||||
|
@ -720,8 +718,6 @@ void RefreshWindowList(HWND hwndCombobox, StringList &classList)
|
|||
RECT clientRect;
|
||||
GetClientRect(hwndCurrent, &clientRect);
|
||||
|
||||
HWND hwndParent = GetParent(hwndCurrent);
|
||||
|
||||
DWORD exStyles = (DWORD)GetWindowLongPtr(hwndCurrent, GWL_EXSTYLE);
|
||||
DWORD styles = (DWORD)GetWindowLongPtr(hwndCurrent, GWL_STYLE);
|
||||
|
||||
|
|
|
@ -105,11 +105,8 @@ public:
|
|||
curEncodeTimestamp = timestamp + ((outputFrameSize-lastSampleSize)*10/441);
|
||||
}
|
||||
|
||||
int framenum1 = lame_get_frameNum(lgf);
|
||||
int ret = lame_encode_buffer_interleaved_ieee_float(lgf, (float*)input, numInputFrames, MP3OutputBuffer.Array()+1, dwMP3MaxSize);
|
||||
|
||||
int framesEncoded = lame_get_frameNum(lgf)-framenum1;
|
||||
|
||||
if(ret < 0)
|
||||
{
|
||||
AppWarning(TEXT("MP3 encode failed"));
|
||||
|
|
|
@ -56,8 +56,6 @@ const float baseCRF = 22.0f;
|
|||
|
||||
bool valid_x264_string(const String &str, const char **x264StringList)
|
||||
{
|
||||
bool bValidString = false;
|
||||
|
||||
do
|
||||
{
|
||||
if(str.CompareI(String(*x264StringList)))
|
||||
|
|
|
@ -372,11 +372,12 @@ void OBS::Start()
|
|||
{
|
||||
String strFileExtension = GetPathExtension(strOutputFile);
|
||||
String strFileWithoutExtension = GetPathWithoutExtension(strOutputFile);
|
||||
UINT curFile = 0;
|
||||
|
||||
if(strFileExtension.IsValid() && !ofd.bDirectory)
|
||||
{
|
||||
String strNewFilePath;
|
||||
UINT curFile = 0;
|
||||
|
||||
do
|
||||
{
|
||||
strNewFilePath.Clear() << strFileWithoutExtension << TEXT(" (") << FormattedString(TEXT("%02u"), ++curFile) << TEXT(").") << strFileExtension;
|
||||
|
@ -806,11 +807,10 @@ bool OBS::QueryNewAudio(QWORD ×tamp)
|
|||
{
|
||||
bool bNewAudio = false;
|
||||
|
||||
UINT audioRet;
|
||||
timestamp = INVALID_LL;
|
||||
|
||||
QWORD desktopTimestamp;
|
||||
while((audioRet = desktopAudio->QueryAudio(curDesktopVol)) != NoAudioAvailable)
|
||||
while((desktopAudio->QueryAudio(curDesktopVol)) != NoAudioAvailable)
|
||||
{
|
||||
bNewAudio = true;
|
||||
|
||||
|
@ -832,7 +832,7 @@ bool OBS::QueryNewAudio(QWORD ×tamp)
|
|||
|
||||
if(micAudio)
|
||||
{
|
||||
while((audioRet = micAudio->QueryAudio(curMicVol)) != NoAudioAvailable);
|
||||
while((micAudio->QueryAudio(curMicVol)) != NoAudioAvailable);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -257,8 +257,6 @@ void OBS::MainCaptureLoop()
|
|||
|
||||
HANDLE hScaleVal = yuvScalePixelShader->GetParameterByName(TEXT("baseDimensionI"));
|
||||
|
||||
LPVOID nullBuff = NULL;
|
||||
|
||||
//----------------------------------------
|
||||
// x264 input buffers
|
||||
|
||||
|
@ -299,6 +297,7 @@ void OBS::MainCaptureLoop()
|
|||
bool bWasLaggedFrame = false;
|
||||
#else
|
||||
DWORD streamTimeStart = OSGetTime();
|
||||
DWORD fpsTimeAdjust = 0;
|
||||
#endif
|
||||
totalStreamTime = 0;
|
||||
|
||||
|
@ -308,8 +307,6 @@ void OBS::MainCaptureLoop()
|
|||
|
||||
DWORD fpsTimeNumerator = 1000-(frameTime*fps);
|
||||
DWORD fpsTimeDenominator = fps;
|
||||
DWORD fpsTimeAdjust = 0;
|
||||
|
||||
DWORD cfrTime = 0;
|
||||
DWORD cfrTimeAdjust = 0;
|
||||
|
||||
|
@ -399,7 +396,7 @@ void OBS::MainCaptureLoop()
|
|||
lastStreamTime = firstFrameTime-frameTime;
|
||||
#endif
|
||||
|
||||
bool bFirstAudioPacket = true;
|
||||
//bool bFirstAudioPacket = true;
|
||||
|
||||
while(bRunning)
|
||||
{
|
||||
|
|
|
@ -240,7 +240,6 @@ RTMPPublisher::~RTMPPublisher()
|
|||
queuedPackets[i].data.Clear();
|
||||
queuedPackets.Clear();
|
||||
|
||||
double dTotalFrames = double(totalFrames);
|
||||
double dBFrameDropPercentage = double(numBFramesDumped)/NumTotalVideoFrames()*100.0;
|
||||
double dPFrameDropPercentage = double(numPFramesDumped)/NumTotalVideoFrames()*100.0;
|
||||
|
||||
|
@ -355,7 +354,8 @@ void RTMPPublisher::SendPacket(BYTE *data, UINT size, DWORD timestamp, PacketTyp
|
|||
bConnecting = true;
|
||||
}
|
||||
|
||||
if (bFirstKeyframe) {
|
||||
if (bFirstKeyframe)
|
||||
{
|
||||
if (!bConnected || type != PacketType_VideoHighest)
|
||||
return;
|
||||
|
||||
|
@ -363,8 +363,10 @@ void RTMPPublisher::SendPacket(BYTE *data, UINT size, DWORD timestamp, PacketTyp
|
|||
bFirstKeyframe = false;
|
||||
}
|
||||
|
||||
if (bufferedPackets.Num() == MAX_BUFFERED_PACKETS) {
|
||||
if (!bBufferFull) {
|
||||
if (bufferedPackets.Num() == MAX_BUFFERED_PACKETS)
|
||||
{
|
||||
if (!bBufferFull)
|
||||
{
|
||||
InitializeBuffer();
|
||||
bBufferFull = true;
|
||||
}
|
||||
|
@ -379,13 +381,17 @@ void RTMPPublisher::SendPacket(BYTE *data, UINT size, DWORD timestamp, PacketTyp
|
|||
timestamp -= firstTimestamp;
|
||||
|
||||
TimedPacket *packet;
|
||||
UINT newID;
|
||||
if (type == PacketType_Audio) {
|
||||
|
||||
if (type == PacketType_Audio)
|
||||
{
|
||||
UINT newID;
|
||||
timestamp -= audioTimeOffset;
|
||||
|
||||
newID = FindClosestBufferIndex(timestamp);
|
||||
packet = bufferedPackets.InsertNew(newID);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
packet = bufferedPackets.CreateNew();
|
||||
}
|
||||
|
||||
|
@ -773,12 +779,12 @@ end:
|
|||
double RTMPPublisher::GetPacketStrain() const
|
||||
{
|
||||
return (curDataBufferLen / (double)dataBufferSize) * 100.0;
|
||||
if(packetWaitType >= PacketType_VideoHigh)
|
||||
/*if(packetWaitType >= PacketType_VideoHigh)
|
||||
return min(100.0, dNetworkStrain*100.0);
|
||||
else if(bNetworkStrain)
|
||||
return dNetworkStrain*66.0;
|
||||
|
||||
return dNetworkStrain*33.0;
|
||||
return dNetworkStrain*33.0;*/
|
||||
}
|
||||
|
||||
QWORD RTMPPublisher::GetCurrentSentBytes()
|
||||
|
|
|
@ -131,7 +131,7 @@ protected:
|
|||
|
||||
void SendLoop();
|
||||
void SocketLoop();
|
||||
int RTMPPublisher::FlushDataBuffer();
|
||||
int FlushDataBuffer();
|
||||
static DWORD SendThread(RTMPPublisher *publisher);
|
||||
static DWORD SocketThread(RTMPPublisher *publisher);
|
||||
|
||||
|
|
|
@ -222,20 +222,20 @@ char* OBS::EncMetaData(char *enc, char *pend, bool bFLVFile)
|
|||
int audioBitRate = GetAudioEncoder()->GetBitRate();
|
||||
CTSTR lpAudioCodec = GetAudioEncoder()->GetCodec();
|
||||
|
||||
double audioCodecID;
|
||||
//double audioCodecID;
|
||||
const AVal *av_codecFourCC;
|
||||
|
||||
#ifdef USE_AAC
|
||||
if(scmpi(lpAudioCodec, TEXT("AAC")) == 0)
|
||||
{
|
||||
av_codecFourCC = &av_mp4a;
|
||||
audioCodecID = 10.0;
|
||||
//audioCodecID = 10.0;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
av_codecFourCC = &av_mp3;
|
||||
audioCodecID = 2.0;
|
||||
//audioCodecID = 2.0;
|
||||
}
|
||||
|
||||
if(bFLVFile)
|
||||
|
|
|
@ -60,7 +60,7 @@ void SettingsEncoding::ApplySettings()
|
|||
AppConfig->SetInt(TEXT("Video Encoding"), TEXT("MaxBitrate"), bitrate);
|
||||
|
||||
UINT bufSize = GetEditText(GetDlgItem(hwnd, IDC_BUFFERSIZE)).ToInt();
|
||||
if(bufSize < 100) bitrate = bufSize;
|
||||
//if(bufSize < 100) bufSize = bitrate; //R1CH: Allow users to enter 0 buffer size to disable VBV, its protected by checkbox anyway
|
||||
AppConfig->SetInt(TEXT("Video Encoding"), TEXT("BufferSize"), bufSize);
|
||||
|
||||
String strTemp = GetCBText(GetDlgItem(hwnd, IDC_AUDIOCODEC));
|
||||
|
|
|
@ -141,11 +141,11 @@ void SettingsVideo::RefreshFilters(HWND hwndParent, bool bGetConfig)
|
|||
if(bGetConfig)
|
||||
curFilter = AppConfig->GetInt(TEXT("Video"), TEXT("Filter"), 0);
|
||||
else
|
||||
curFilter = (int)SendMessage(GetDlgItem(hwnd, IDC_FILTER), CB_GETCURSEL, 0, 0);
|
||||
curFilter = (int)SendMessage(hwndFilter, CB_GETCURSEL, 0, 0);
|
||||
|
||||
float downscale = 1.0f;
|
||||
|
||||
int curSel = (int)SendMessage(GetDlgItem(hwnd, IDC_DOWNSCALE), CB_GETCURSEL, 0, 0);
|
||||
int curSel = (int)SendMessage(hwndDownscale, CB_GETCURSEL, 0, 0);
|
||||
if(curSel != CB_ERR)
|
||||
downscale = downscaleMultipliers[curSel];
|
||||
|
||||
|
@ -411,9 +411,6 @@ INT_PTR SettingsVideo::ProcMessage(UINT message, WPARAM wParam, LPARAM lParam)
|
|||
if(HIWORD(wParam) != EN_CHANGE)
|
||||
break;
|
||||
|
||||
String strInt = GetEditText((HWND)lParam);
|
||||
int iVal = strInt.ToInt();
|
||||
|
||||
int cx = GetEditText(GetDlgItem(hwnd, IDC_SIZEX)).ToInt();
|
||||
int cy = GetEditText(GetDlgItem(hwnd, IDC_SIZEY)).ToInt();
|
||||
|
||||
|
|
|
@ -731,7 +731,7 @@ void DoCancelStuff(HWND hwnd)
|
|||
{
|
||||
ConfigTextSourceInfo *configInfo = (ConfigTextSourceInfo*)GetWindowLongPtr(hwnd, DWLP_USER);
|
||||
ImageSource *source = API->GetSceneImageSource(configInfo->lpName);
|
||||
XElement *data = configInfo->data;
|
||||
//XElement *data = configInfo->data;
|
||||
|
||||
if(source)
|
||||
source->UpdateSettings();
|
||||
|
|
|
@ -51,7 +51,6 @@ VOID GenerateGUID(String &strGUID)
|
|||
|
||||
BOOL CalculateFileHash (TCHAR *path, BYTE *hash)
|
||||
{
|
||||
BYTE buff[65536];
|
||||
HCRYPTHASH hHash;
|
||||
|
||||
if (!CryptCreateHash(hProvider, CALG_SHA1, 0, 0, &hHash))
|
||||
|
@ -61,6 +60,8 @@ BOOL CalculateFileHash (TCHAR *path, BYTE *hash)
|
|||
|
||||
if (file.Open(path, XFILE_READ, OPEN_EXISTING))
|
||||
{
|
||||
BYTE buff[65536];
|
||||
|
||||
for (;;)
|
||||
{
|
||||
DWORD read = file.Read(buff, sizeof(buff));
|
||||
|
@ -226,11 +227,11 @@ BOOL ParseUpdateManifest (TCHAR *path, BOOL *updatesAvailable, String &descripti
|
|||
filePath << path;
|
||||
filePath << fileName;
|
||||
|
||||
BYTE fileHash[20];
|
||||
TCHAR fileHashString[41];
|
||||
|
||||
if (OSFileExists(filePath))
|
||||
{
|
||||
BYTE fileHash[20];
|
||||
TCHAR fileHashString[41];
|
||||
|
||||
if (!CalculateFileHash(filePath, fileHash))
|
||||
continue;
|
||||
|
||||
|
|
|
@ -914,7 +914,6 @@ LRESULT CALLBACK OBS::ListboxHook(HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
|||
void OBS::DeleteItems()
|
||||
{
|
||||
HWND hwndSources = GetDlgItem(hwndMain, ID_SOURCES);
|
||||
UINT numSelected = ListView_GetSelectedCount(hwndSources);
|
||||
int numItems = ListView_GetItemCount(hwndSources);
|
||||
|
||||
List<SceneItem*> selectedSceneItems;
|
||||
|
@ -987,7 +986,6 @@ void OBS::DeleteItems()
|
|||
void OBS::SetSourceOrder(StringList &sourceNames)
|
||||
{
|
||||
HWND hwndSources = GetDlgItem(hwndMain, ID_SOURCES);
|
||||
UINT numSelected = ListView_GetSelectedCount(hwndSources);
|
||||
int numItems = ListView_GetItemCount(hwndSources);
|
||||
|
||||
if(numItems == 0)
|
||||
|
@ -1042,7 +1040,6 @@ void OBS::SetSourceOrder(StringList &sourceNames)
|
|||
void OBS::MoveSourcesUp()
|
||||
{
|
||||
HWND hwndSources = GetDlgItem(hwndMain, ID_SOURCES);
|
||||
UINT numSelected = ListView_GetSelectedCount(hwndSources);
|
||||
int numItems = ListView_GetItemCount(hwndSources);
|
||||
UINT focusedItem = -1, selectionMark;
|
||||
|
||||
|
@ -1184,7 +1181,6 @@ void OBS::MoveSourcesDown()
|
|||
void OBS::MoveSourcesToTop()
|
||||
{
|
||||
HWND hwndSources = GetDlgItem(hwndMain, ID_SOURCES);
|
||||
UINT numSelected = ListView_GetSelectedCount(hwndSources);
|
||||
int numItems = ListView_GetItemCount(hwndSources);
|
||||
UINT focusedItem = -1, selectionMark;
|
||||
|
||||
|
@ -1259,7 +1255,6 @@ void OBS::MoveSourcesToTop()
|
|||
void OBS::MoveSourcesToBottom()
|
||||
{
|
||||
HWND hwndSources = GetDlgItem(hwndMain, ID_SOURCES);
|
||||
UINT numSelected = ListView_GetSelectedCount(hwndSources);
|
||||
int numItems = ListView_GetItemCount(hwndSources);
|
||||
UINT focusedItem = -1, selectionMark;
|
||||
|
||||
|
@ -2278,7 +2273,7 @@ LRESULT CALLBACK OBS::OBSProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||
case WM_NOTIFY:
|
||||
{
|
||||
NMHDR nmh = *(LPNMHDR)lParam;
|
||||
static bool bHighlighted;
|
||||
|
||||
switch(wParam)
|
||||
{
|
||||
case ID_SOURCES:
|
||||
|
@ -2473,10 +2468,10 @@ LRESULT CALLBACK OBS::OBSProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||
int newWidth = MAX(screenSize.right - screenSize.left, minClientWidth+App->borderXSize);
|
||||
int newHeight = MAX(screenSize.bottom - screenSize.top , minClientHeight+App->borderYSize);
|
||||
|
||||
int maxCX = GetSystemMetrics(SM_CXFULLSCREEN);
|
||||
/*int maxCX = GetSystemMetrics(SM_CXFULLSCREEN);
|
||||
int maxCY = GetSystemMetrics(SM_CYFULLSCREEN);
|
||||
|
||||
/*if(newWidth > maxCX)
|
||||
if(newWidth > maxCX)
|
||||
newWidth = maxCX;
|
||||
if(newHeight > maxCY)
|
||||
newHeight = maxCY;*/
|
||||
|
@ -2839,8 +2834,6 @@ LRESULT CALLBACK OBS::RenderFrameProc(HWND hwnd, UINT message, WPARAM wParam, LP
|
|||
List<SceneItem*> items;
|
||||
App->scene->GetSelectedItems(items);
|
||||
|
||||
bool bInside = false;
|
||||
|
||||
App->scaleItem = NULL;
|
||||
App->modifyType = ItemModifyType_None;
|
||||
|
||||
|
|
Loading…
Reference in New Issue