From 89fdb71c854b2b5081e1cb5ec3e26e1bb93e3b60 Mon Sep 17 00:00:00 2001 From: brunzelchen Date: Wed, 24 Nov 2010 18:02:06 +0000 Subject: - fix: crash at startup (my fault) - fix: it was possible to add non-medley songs to the medley playlist -> crash in singscreen - updated polish language (thx to Pit33) - deactivate all elements (but not background/video) in singscreen (with "N") git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2751 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/lib/DSPack/UCaptureWDM.pas | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'Game/Code/lib/DSPack/UCaptureWDM.pas') diff --git a/Game/Code/lib/DSPack/UCaptureWDM.pas b/Game/Code/lib/DSPack/UCaptureWDM.pas index 156e160a..c483e58a 100644 --- a/Game/Code/lib/DSPack/UCaptureWDM.pas +++ b/Game/Code/lib/DSPack/UCaptureWDM.pas @@ -8,7 +8,7 @@ unit UCaptureWDM; interface uses - Classes, Windows, DSPack, DirectShow9, DSUtil, SDL, ExtCtrls, SyncObjs; + Classes, Windows, DSPack, DirectShow9, DSUtil, SDL, ExtCtrls, SyncObjs, ULog; type TCaptureState = (csPlay, csStop, csDisbaled); @@ -66,27 +66,36 @@ type procedure Stop; end; - function GetCapDevices: TList; function ListMediaTypes(DeviceID: integer): TList; + procedure GetCapDevices(var names: TList); implementation uses Graphics, SysUtils; -function GetCapDevices: TList; +procedure GetCapDevices(var names: TList); var k: Integer; tSysDev: TSysDevEnum; begin - SetLength(Result, 0); - tSysDev := TSysDevEnum.Create(CLSID_VideoInputDeviceCategory); - - SetLength(Result, tSysDev.CountFilters); - for k := 0 to tSysDev.CountFilters - 1 do - Result[k] := tSysDev.Filters[k].FriendlyName; + SetLength(names, 0); + try + tSysDev := TSysDevEnum.Create(CLSID_VideoInputDeviceCategory); + SetLength(names, tSysDev.CountFilters); + for k := 0 to tSysDev.CountFilters - 1 do + names[k] := tSysDev.Filters[k].FriendlyName; + except + SetLength(names, 0); + //Log.LogError('GetCapDevices #4'); + end; - tSysDev.Free; + try + if (tSysDev<>nil) then + tSysDev.Free; + except + //Log.LogError('GetCapDevices #6'); + end; end; function ListMediaTypes(DeviceID: integer): TList; -- cgit v1.2.3