From 2702259c75a210c4fef120056d96800a82b1a077 Mon Sep 17 00:00:00 2001 From: Palana Date: Wed, 2 Jul 2014 18:50:46 +0200 Subject: [PATCH] Add DecodeDeviceId helper with DStr targets --- plugins/win-dshow/win-dshow.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/plugins/win-dshow/win-dshow.cpp b/plugins/win-dshow/win-dshow.cpp index e0170a3b4..d533d8043 100644 --- a/plugins/win-dshow/win-dshow.cpp +++ b/plugins/win-dshow/win-dshow.cpp @@ -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 wname = dstr_to_wcs(name); out.name = wname;