Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
f1579f90
Commit
f1579f90
authored
Jun 30, 2004
by
Derk-Jan Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* first stab at vlc daemon mode (-d, --daemon )
parent
10c1b268
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
3 deletions
+44
-3
include/main.h
include/main.h
+4
-1
src/libvlc.c
src/libvlc.c
+28
-0
src/libvlc.h
src/libvlc.h
+12
-2
No files found.
include/main.h
View file @
f1579f90
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* Declaration and extern access to global program object.
* Declaration and extern access to global program object.
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
* $Id
: main.h,v 1.57 2004/01/25 18:17:08 zorglub Exp
$
* $Id$
*
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
*
...
@@ -55,6 +55,9 @@ struct libvlc_t
...
@@ -55,6 +55,9 @@ struct libvlc_t
module_bank_t
*
p_module_bank
;
module_bank_t
*
p_module_bank
;
/* Arch-specific variables */
/* Arch-specific variables */
#if !defined( WIN32 )
vlc_bool_t
b_daemon
;
#endif
#if defined( SYS_BEOS )
#if defined( SYS_BEOS )
vlc_object_t
*
p_appthread
;
vlc_object_t
*
p_appthread
;
char
*
psz_vlcpath
;
char
*
psz_vlcpath
;
...
...
src/libvlc.c
View file @
f1579f90
...
@@ -570,6 +570,34 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
...
@@ -570,6 +570,34 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
{
{
p_vlc
->
pf_memset
=
memset
;
p_vlc
->
pf_memset
=
memset
;
}
}
/* Check for daemon mode */
if
(
config_GetInt
(
p_vlc
,
"daemon"
)
)
{
pid_t
i_pid
=
0
;
if
(
(
i_pid
=
fork
()
)
<
0
)
{
msg_Err
(
p_vlc
,
"Unable to fork vlc to daemon mode"
);
exit
(
1
);
}
else
if
(
i_pid
)
{
/* This is the parent, exit right now */
msg_Dbg
(
p_vlc
,
"closing parent process"
);
exit
(
0
);
}
else
{
/* we are the child */
msg_Dbg
(
p_vlc
,
"we are the child !!!"
);
close
(
0
);
close
(
1
);
close
(
2
);
p_vlc
->
p_libvlc
->
b_daemon
=
VLC_TRUE
;
//VLC_AddIntf( 0, "logger,none", VLC_FALSE, VLC_FALSE );
}
}
/*
/*
* Initialize hotkey handling
* Initialize hotkey handling
...
...
src/libvlc.h
View file @
f1579f90
...
@@ -593,6 +593,10 @@ static char *ppsz_align_descriptions[] =
...
@@ -593,6 +593,10 @@ static char *ppsz_align_descriptions[] =
"This option allows you to use a plugins cache which will greatly " \
"This option allows you to use a plugins cache which will greatly " \
"improve the start time of VLC.")
"improve the start time of VLC.")
#define DAEMON_TEXT N_("Run as daemon proces")
#define DAEMON_LONGTEXT N_( \
"Runs VLC as a background daemon proces.")
#define ONEINSTANCE_TEXT N_("Allow only one running instance")
#define ONEINSTANCE_TEXT N_("Allow only one running instance")
#define ONEINSTANCE_LONGTEXT N_( \
#define ONEINSTANCE_LONGTEXT N_( \
"Allowing only one running instance of VLC can sometimes be useful, " \
"Allowing only one running instance of VLC can sometimes be useful, " \
...
@@ -966,10 +970,16 @@ vlc_module_begin();
...
@@ -966,10 +970,16 @@ vlc_module_begin();
DEMUX_LONGTEXT
,
VLC_TRUE
);
DEMUX_LONGTEXT
,
VLC_TRUE
);
add_bool
(
"minimize-threads"
,
0
,
NULL
,
MINIMIZE_THREADS_TEXT
,
add_bool
(
"minimize-threads"
,
0
,
NULL
,
MINIMIZE_THREADS_TEXT
,
MINIMIZE_THREADS_LONGTEXT
,
VLC_TRUE
);
MINIMIZE_THREADS_LONGTEXT
,
VLC_TRUE
);
add_directory
(
"plugin-path"
,
NULL
,
NULL
,
PLUGIN_PATH_TEXT
,
PLUGIN_PATH_LONGTEXT
,
VLC_TRUE
);
add_bool
(
"plugins-cache"
,
0
,
NULL
,
PLUGINS_CACHE_TEXT
,
add_bool
(
"plugins-cache"
,
0
,
NULL
,
PLUGINS_CACHE_TEXT
,
PLUGINS_CACHE_LONGTEXT
,
VLC_TRUE
);
PLUGINS_CACHE_LONGTEXT
,
VLC_TRUE
);
add_directory
(
"plugin-path"
,
NULL
,
NULL
,
PLUGIN_PATH_TEXT
,
PLUGIN_PATH_LONGTEXT
,
VLC_TRUE
);
#if !defined(WIN32)
add_bool
(
"daemon"
,
0
,
NULL
,
DAEMON_TEXT
,
DAEMON_LONGTEXT
,
VLC_TRUE
);
change_short
(
'd'
);
#endif
#if !defined(SYS_DARWIN) && !defined(SYS_BEOS) && defined(PTHREAD_COND_T_IN_PTHREAD_H)
#if !defined(SYS_DARWIN) && !defined(SYS_BEOS) && defined(PTHREAD_COND_T_IN_PTHREAD_H)
add_bool
(
"rt-priority"
,
0
,
NULL
,
RT_PRIORITY_TEXT
,
add_bool
(
"rt-priority"
,
0
,
NULL
,
RT_PRIORITY_TEXT
,
...
...
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