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
25214cb3
Commit
25214cb3
authored
Jun 12, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
access_shm: use HAVE_SYS_SHM_H
parent
a2dd68cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
modules/access/shm.c
modules/access/shm.c
+14
-4
No files found.
modules/access/shm.c
View file @
25214cb3
...
...
@@ -26,8 +26,10 @@
#include <stdarg.h>
#include <fcntl.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#ifdef HAVE_SYS_SHM_H
# include <sys/ipc.h>
# include <sys/shm.h>
#endif
#include <sys/mman.h>
#include <vlc_common.h>
...
...
@@ -105,16 +107,19 @@ vlc_module_begin ()
* memory location via an unsafe variable rather than the URL. */
add_string
(
"shm-file"
,
NULL
,
FILE_TEXT
,
FILE_LONGTEXT
,
false
)
change_volatile
()
#ifdef HAVE_SYS_SHM_H
add_integer
(
"shm-id"
,
(
int64_t
)
IPC_PRIVATE
,
ID_TEXT
,
ID_LONGTEXT
,
false
)
change_volatile
()
#endif
add_shortcut
(
"shm"
)
vlc_module_end
()
static
void
Demux
(
void
*
);
static
int
Control
(
demux_t
*
,
int
,
va_list
);
static
void
map_detach
(
demux_sys_t
*
);
#ifdef HAVE_SYS_SHM_H
static
void
sysv_detach
(
demux_sys_t
*
);
#endif
static
void
no_detach
(
demux_sys_t
*
);
struct
demux_sys_t
...
...
@@ -198,6 +203,7 @@ static int Open (vlc_object_t *obj)
}
else
{
#ifdef HAVE_SYS_SHM_H
int
id
=
var_InheritInteger
(
demux
,
"shm-id"
);
if
(
id
==
IPC_PRIVATE
)
goto
error
;
...
...
@@ -210,6 +216,9 @@ static int Open (vlc_object_t *obj)
}
sys
->
addr
=
mem
;
sys
->
detach
=
sysv_detach
;
#else
goto
error
;
#endif
}
/* Initializes format */
...
...
@@ -274,11 +283,12 @@ static void map_detach (demux_sys_t *sys)
munmap
((
void
*
)
sys
->
addr
,
sys
->
length
);
}
#ifdef HAVE_SYS_SHM_H
static
void
sysv_detach
(
demux_sys_t
*
sys
)
{
shmdt
(
sys
->
addr
);
}
#endif
static
void
no_detach
(
demux_sys_t
*
sys
)
{
...
...
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