From ec49bde7e1919e5a460c05903b6ccafc00be0455 Mon Sep 17 00:00:00 2001 From: tobigun Date: Mon, 19 Apr 2010 21:40:23 +0000 Subject: bugfix for crash with portaudio (all platforms): - UAudioInput_Portaudio: UnifyDeviceNames was called with the wrong index further changes: - BASS input source-names seem to be encoded with local encoding and are converted to UTF8 - Portaudio source and device names encoding is auto-detected and converted to UTF8 - some clean-up git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2252 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/base/URecord.pas | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/base') diff --git a/src/base/URecord.pas b/src/base/URecord.pas index c4612adb..09ac92de 100644 --- a/src/base/URecord.pas +++ b/src/base/URecord.pas @@ -95,7 +95,7 @@ const type TAudioInputSource = record - Name: string; + Name: UTF8String; end; // soundcard input-devices information @@ -745,7 +745,7 @@ function TAudioInputBase.UnifyDeviceName(const name: UTF8String; deviceIndex: in var count: integer; // count of devices with this name - function IsDuplicate(const name: string): boolean; + function IsDuplicate(const name: UTF8String): boolean; var i: integer; begin @@ -754,11 +754,13 @@ var for i := 0 to deviceIndex-1 do begin if (AudioInputProcessor.DeviceList[i] <> nil) then - if (AudioInputProcessor.DeviceList[i].Name = name) then - begin - Result := true; - Break; - end; + begin + if (AudioInputProcessor.DeviceList[i].Name = name) then + begin + Result := true; + Break; + end; + end; end; end; -- cgit v1.2.3