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
d8c9ed53
Commit
d8c9ed53
authored
Apr 11, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VLC: infrastructure to detect and/or work-around thread-unsafe calls
parent
2b7581cd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
1 deletion
+84
-1
bin/Makefile.am
bin/Makefile.am
+1
-1
bin/override.c
bin/override.c
+80
-0
bin/vlc.c
bin/vlc.c
+3
-0
No files found.
bin/Makefile.am
View file @
d8c9ed53
...
...
@@ -14,7 +14,7 @@ AM_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
if
!HAVE_WIN32
if
!HAVE_WINCE
bin_PROGRAMS
+=
vlc-wrapper
vlc_SOURCES
=
vlc.c
vlc_SOURCES
=
vlc.c
override.c
endif
endif
...
...
bin/override.c
0 → 100644
View file @
d8c9ed53
/*****************************************************************************
* override.c: overriden function calls for VLC media player
*****************************************************************************
* Copyright (C) 2010 Rémi Denis-Courmont
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdbool.h>
void
vlc_enable_override
(
void
);
static
bool
override
=
false
;
void
vlc_enable_override
(
void
)
{
override
=
true
;
}
#if defined (__GNUC__)
/* typeof and statement-expression */
\
&& (defined (__ELF__) && !defined (__sun__))
/* Solaris crashes on printf("%s", NULL); which is legal, but annoying. */
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>
static
void
vlogbug
(
const
char
*
level
,
const
char
*
func
,
const
char
*
fmt
,
va_list
ap
)
{
flockfile
(
stderr
);
fprintf
(
stderr
,
"%s: call to %s("
,
level
,
func
);
vfprintf
(
stderr
,
fmt
,
ap
);
fputs
(
")
\n
"
,
stderr
);
funlockfile
(
stderr
);
}
static
void
logbug
(
const
char
*
level
,
const
char
*
func
,
const
char
*
fmt
,
...)
{
va_list
ap
;
va_start
(
ap
,
fmt
);
vlogbug
(
level
,
func
,
fmt
,
ap
);
va_end
(
ap
);
}
static
void
*
getsym
(
const
char
*
name
)
{
void
*
sym
=
dlsym
(
RTLD_NEXT
,
name
);
if
(
sym
==
NULL
)
{
fprintf
(
stderr
,
"Cannot resolve symbol %s!
\n
"
,
name
);
abort
();
}
return
sym
;
}
#define LOG(level, ...) logbug(level, __func__, __VA_ARGS__)
#define CALL(func, ...) \
({ typeof (func) *sym = getsym ( # func); sym (__VA_ARGS__); })
#endif
/* __ELF__ */
bin/vlc.c
View file @
d8c9ed53
...
...
@@ -42,6 +42,7 @@
/* Explicit HACK */
extern
void
LocaleFree
(
const
char
*
);
extern
char
*
FromLocale
(
const
char
*
);
extern
void
vlc_enable_override
(
void
);
#include <signal.h>
#include <time.h>
...
...
@@ -157,6 +158,8 @@ int main( int i_argc, const char *ppsz_argv[] )
return
1
;
// BOOM!
argv
[
argc
]
=
NULL
;
vlc_enable_override
();
/* Initialize libvlc */
libvlc_instance_t
*
vlc
=
libvlc_new
(
argc
,
argv
);
...
...
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