From e0105c9c37a69867de1425601ad4ab53e57925b0 Mon Sep 17 00:00:00 2001 From: christian_u Date: Sat, 2 Nov 2013 07:56:42 +0000 Subject: [PATCH] trial to fix libsmpeg loading (mpeg support) git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2828 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/acs/Demos/player/player.lpi | 191 ++++++++++++++++-- components/acs/Src/classes/acs_procs.pas | 11 +- .../acs/Src/fileformats/linux/smpeg.pas | 8 +- 3 files changed, 191 insertions(+), 19 deletions(-) diff --git a/components/acs/Demos/player/player.lpi b/components/acs/Demos/player/player.lpi index b656b5e46..c053e9280 100644 --- a/components/acs/Demos/player/player.lpi +++ b/components/acs/Demos/player/player.lpi @@ -35,17 +35,16 @@ - + - - + @@ -60,7 +59,7 @@ - + @@ -117,9 +116,13 @@ + + - - + + + + @@ -222,7 +225,7 @@ - + @@ -244,7 +247,7 @@ - + @@ -816,14 +819,178 @@ + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/acs/Src/classes/acs_procs.pas b/components/acs/Src/classes/acs_procs.pas index e3e09a19f..d5ac27595 100644 --- a/components/acs/Src/classes/acs_procs.pas +++ b/components/acs/Src/classes/acs_procs.pas @@ -88,14 +88,21 @@ implementation Path := '/usr/lib/'; if FindFirst(Path + Pattern, faAnyFile, SR) = 0 then begin - Result := SR.Name; + Result := Path+SR.Name; + FindClose(SR); + Exit; + end; + Path := '/usr/lib/x86_64-linux-gnu/'; + if FindFirst(Path + Pattern, faAnyFile, SR) = 0 then + begin + Result := Path+SR.Name; FindClose(SR); Exit; end; Path := '/usr/local/lib/'; if FindFirst(Path + Pattern, faAnyFile, SR) = 0 then begin - Result := SR.Name; + Result := Path+SR.Name; FindClose(SR); Exit; end; diff --git a/components/acs/Src/fileformats/linux/smpeg.pas b/components/acs/Src/fileformats/linux/smpeg.pas index 1eb83f2cd..8678aae64 100644 --- a/components/acs/Src/fileformats/linux/smpeg.pas +++ b/components/acs/Src/fileformats/linux/smpeg.pas @@ -110,7 +110,7 @@ const {$ifdef LINUX} LibsmpegPath = 'libsmpeg*.so*'; - LibSDLPath = 'libSDL*.so*'; + LibSDLPath = 'libSDL-*.so*'; {$ELSE} LibsmpegPath = 'smpeg.dll'; LibSDLPath = 'SDL.dll'; @@ -189,16 +189,14 @@ var begin {$ifdef LINUX} Path := FindLibs(LibSDLPath); - if Path <> '' then SDLhandle := dlopen(@Path[1], RTLD_NOW or RTLD_GLOBAL); -// SDLhandle := dlopen(LibSDLPath, RTLD_NOW{$IFDEF LINUX} or RTLD_GLOBAL{$ENDIF}); + if Path <> '' then SDLhandle := dlopen(@Path, RTLD_NOW or RTLD_GLOBAL); if SDLhandle = nil then exit; SDL_Init := dlsym(SDLhandle, 'SDL_Init'); SDL_Quit := dlsym(SDLhandle, 'SDL_Quit'); SDL_Init(SDL_INIT_AUDIO); Path := FindLibs(LibsmpegPath); - if Path <> '' then Libhandle := dlopen(@Path[1], RTLD_NOW or RTLD_GLOBAL); -// Libhandle := dlopen(LibsmpegPath, RTLD_NOW{$IFDEF LINUX} or RTLD_GLOBAL{$ENDIF}); + if Path <> '' then Libhandle := dlopen(@Path, RTLD_NOW or RTLD_GLOBAL); if Libhandle = nil then exit; if Libhandle <> nil then begin