Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
79399150
Commit
79399150
authored
Jan 13, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Linux: do not hardcode libvlc.so, use address space match instead
parent
fcf05b24
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
src/misc/linux_specific.c
src/misc/linux_specific.c
+16
-10
No files found.
src/misc/linux_specific.c
View file @
79399150
...
...
@@ -31,6 +31,7 @@
#if 0
#include <assert.h>
#include <pthread.h>
#include <limits.h>
static void set_libvlc_path (void)
{
...
...
@@ -45,29 +46,34 @@ static void set_libvlc_path (void)
if (maps == NULL)
return;
char *line = NULL;
size_t linelen = 0;
uintptr_t needle = (uintptr_t)set_libvlc_path;
for (;;)
{
char buf[5000], *dir, *end;
if (fgets (buf, sizeof (buf), maps) == NULL)
ssize_t len = getline (&line, &linelen, maps);
if (len == -1)
break;
dir = strchr (buf, '/');
void *start, *end;
if (sscanf (line, "%p-%p", &start, &end) < 2)
continue;
if (needle < (uintptr_t)start || (uintptr_t)end <= needle)
continue;
char *dir = strchr (line, '/');
if (dir == NULL)
continue;
end = strrchr (dir
, '/');
char *file = strrchr (line
, '/');
if (end == NULL)
continue;
if (strncmp (end + 1, "libvlc.so.", 10))
continue;
*end = '\0';
*file = '\0';
printf ("libvlc at %s\n", dir);
if (strlen (dir) < sizeof (libvlc_path))
strcpy (libvlc_path, dir);
break;
}
free (line);
fclose (maps);
}
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment