mirror of
https://github.com/isledecomp/isle-portable.git
synced 2024-11-29 10:55:42 -05:00
perfect SetDeviceName
This commit is contained in:
parent
8b58e6fe28
commit
e6f8da256f
1 changed files with 8 additions and 7 deletions
|
@ -30,21 +30,22 @@ MxVideoParam &MxVideoParam::operator=(const MxVideoParam &other)
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: this doesn't match exactly, something weird with the conditional on id
|
|
||||||
void MxVideoParam::SetDeviceName(char *id)
|
void MxVideoParam::SetDeviceName(char *id)
|
||||||
{
|
{
|
||||||
if (this->m_deviceId != 0)
|
if (this->m_deviceId != 0)
|
||||||
free(this->m_deviceId);
|
free(this->m_deviceId);
|
||||||
|
|
||||||
if (id == 0)
|
if (id != 0)
|
||||||
{
|
|
||||||
this->m_deviceId = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
this->m_deviceId = (char *)malloc(strlen(id) + 1);
|
this->m_deviceId = (char *)malloc(strlen(id) + 1);
|
||||||
|
|
||||||
|
if (this->m_deviceId != 0) {
|
||||||
strcpy(this->m_deviceId, id);
|
strcpy(this->m_deviceId, id);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this->m_deviceId = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MxVideoParam::~MxVideoParam()
|
MxVideoParam::~MxVideoParam()
|
||||||
|
|
Loading…
Reference in a new issue