Quellcode durchsuchen

Add DecodeDeviceId helper with DStr targets

Palana vor 11 Jahren
Ursprung
Commit
2702259c75
1 geänderte Dateien mit 12 neuen und 3 gelöschten Zeilen
  1. 12 3
      plugins/win-dshow/win-dshow.cpp

+ 12 - 3
plugins/win-dshow/win-dshow.cpp

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