Add DecodeDeviceId helper with DStr targets

This commit is contained in:
Palana
2014-07-02 18:50:46 +02:00
parent fdc2ebf980
commit 2702259c75

View File

@@ -156,10 +156,9 @@ void DShowInput::OnVideoData(DShowInput *input, unsigned char *data,
UNUSED_PARAMETER(size);
}
static bool DecodeDeviceId(DeviceId &out, const char *device_id)
static bool DecodeDeviceId(DStr &name, DStr &path, const char *device_id)
{
const char *path_str;
DStr name, path;
const char *path_str;
if (!device_id || !*device_id)
return false;
@@ -178,6 +177,16 @@ static bool DecodeDeviceId(DeviceId &out, const char *device_id)
decode_dstr(name);
decode_dstr(path);
return true;
}
static bool DecodeDeviceId(DeviceId &out, const char *device_id)
{
DStr name, path;
if (!DecodeDeviceId(name, path, device_id))
return false;
BPtr<wchar_t> wname = dstr_to_wcs(name);
out.name = wname;