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
b271b9ff
Commit
b271b9ff
authored
Jun 13, 2007
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added --run-time option to specify how many second VLC will play an item
(Usefull to save live programs like DVB/UDP)
parent
a14c0186
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
7 deletions
+25
-7
src/input/input.c
src/input/input.c
+17
-7
src/input/input_internal.h
src/input/input_internal.h
+1
-0
src/input/var.c
src/input/var.c
+1
-0
src/libvlc-module.c
src/libvlc-module.c
+6
-0
No files found.
src/input/input.c
View file @
b271b9ff
...
@@ -147,6 +147,7 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
...
@@ -147,6 +147,7 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
p_input
->
p
->
i_start
=
0
;
p_input
->
p
->
i_start
=
0
;
p_input
->
i_time
=
0
;
p_input
->
i_time
=
0
;
p_input
->
p
->
i_stop
=
0
;
p_input
->
p
->
i_stop
=
0
;
p_input
->
p
->
i_run
=
0
;
p_input
->
p
->
i_title
=
0
;
p_input
->
p
->
i_title
=
0
;
p_input
->
p
->
title
=
NULL
;
p_input
->
p
->
title
=
NULL
;
p_input
->
p
->
i_title_offset
=
p_input
->
p
->
i_seekpoint_offset
=
0
;
p_input
->
p
->
i_title_offset
=
p_input
->
p
->
i_seekpoint_offset
=
0
;
...
@@ -573,6 +574,7 @@ exit:
...
@@ -573,6 +574,7 @@ exit:
*****************************************************************************/
*****************************************************************************/
static
void
MainLoop
(
input_thread_t
*
p_input
)
static
void
MainLoop
(
input_thread_t
*
p_input
)
{
{
int64_t
i_start_mdate
=
mdate
();
int64_t
i_intf_update
=
0
;
int64_t
i_intf_update
=
0
;
int
i_updates
=
0
;
int
i_updates
=
0
;
...
@@ -586,10 +588,11 @@ static void MainLoop( input_thread_t *p_input )
...
@@ -586,10 +588,11 @@ static void MainLoop( input_thread_t *p_input )
/* Do the read */
/* Do the read */
if
(
p_input
->
i_state
!=
PAUSE_S
)
if
(
p_input
->
i_state
!=
PAUSE_S
)
{
{
if
(
p_input
->
p
->
i_stop
<=
0
||
p_input
->
i_time
<
p_input
->
p
->
i_stop
)
if
(
(
p_input
->
p
->
i_stop
>
0
&&
p_input
->
i_time
>=
p_input
->
p
->
i_stop
)
||
i_ret
=
p_input
->
p
->
input
.
p_demux
->
pf_demux
(
p_input
->
p
->
input
.
p_demux
);
(
p_input
->
p
->
i_run
>
0
&&
i_start_mdate
+
p_input
->
p
->
i_run
<
mdate
()
)
)
i_ret
=
0
;
/* EOF */
else
else
i_ret
=
0
;
/* EOF */
i_ret
=
p_input
->
p
->
input
.
p_demux
->
pf_demux
(
p_input
->
p
->
input
.
p_demux
);
if
(
i_ret
>
0
)
if
(
i_ret
>
0
)
{
{
...
@@ -659,6 +662,9 @@ static void MainLoop( input_thread_t *p_input )
...
@@ -659,6 +662,9 @@ static void MainLoop( input_thread_t *p_input )
input_ControlPush
(
p_input
,
INPUT_CONTROL_SET_POSITION
,
input_ControlPush
(
p_input
,
INPUT_CONTROL_SET_POSITION
,
&
val
);
&
val
);
}
}
/* */
i_start_mdate
=
mdate
();
}
}
}
}
else
if
(
i_ret
<
0
)
else
if
(
i_ret
<
0
)
...
@@ -915,10 +921,14 @@ static int Init( input_thread_t * p_input )
...
@@ -915,10 +921,14 @@ static int Init( input_thread_t * p_input )
/* Start time*/
/* Start time*/
/* Set start time */
/* Set start time */
p_input
->
p
->
i_start
=
(
int64_t
)
var_GetInteger
(
p_input
,
"start-time"
)
*
p_input
->
p
->
i_start
=
I64C
(
1000000
)
*
var_GetInteger
(
p_input
,
"start-time"
);
I64C
(
1000000
);
p_input
->
p
->
i_stop
=
I64C
(
1000000
)
*
var_GetInteger
(
p_input
,
"stop-time"
);
p_input
->
p
->
i_stop
=
(
int64_t
)
var_GetInteger
(
p_input
,
"stop-time"
)
*
p_input
->
p
->
i_run
=
I64C
(
1000000
)
*
var_GetInteger
(
p_input
,
"run-time"
);
I64C
(
1000000
);
if
(
p_input
->
p
->
i_run
<
0
)
{
msg_Warn
(
p_input
,
"invalid run-time ignored"
);
p_input
->
p
->
i_run
=
0
;
}
if
(
p_input
->
p
->
i_start
>
0
)
if
(
p_input
->
p
->
i_start
>
0
)
{
{
...
...
src/input/input_internal.h
View file @
b271b9ff
...
@@ -75,6 +75,7 @@ struct input_thread_private_t
...
@@ -75,6 +75,7 @@ struct input_thread_private_t
/* */
/* */
int64_t
i_start
;
/* :start-time,0 by default */
int64_t
i_start
;
/* :start-time,0 by default */
int64_t
i_stop
;
/* :stop-time, 0 if none */
int64_t
i_stop
;
/* :stop-time, 0 if none */
int64_t
i_run
;
/* :run-time, 0 if none */
/* Title infos FIXME multi-input (not easy) ? */
/* Title infos FIXME multi-input (not easy) ? */
int
i_title
;
int
i_title
;
...
...
src/input/var.c
View file @
b271b9ff
...
@@ -432,6 +432,7 @@ void input_ConfigVarInit ( input_thread_t *p_input )
...
@@ -432,6 +432,7 @@ void input_ConfigVarInit ( input_thread_t *p_input )
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_input
,
"start-time"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_input
,
"start-time"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_input
,
"stop-time"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_input
,
"stop-time"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_input
,
"run-time"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_input
,
"input-slave"
,
var_Create
(
p_input
,
"input-slave"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
...
...
src/libvlc-module.c
View file @
b271b9ff
...
@@ -531,6 +531,10 @@ static const char *ppsz_clock_descriptions[] =
...
@@ -531,6 +531,10 @@ static const char *ppsz_clock_descriptions[] =
#define STOP_TIME_LONGTEXT N_( \
#define STOP_TIME_LONGTEXT N_( \
"The stream will stop at this position (in seconds)." )
"The stream will stop at this position (in seconds)." )
#define RUN_TIME_TEXT N_("Run time")
#define RUN_TIME_LONGTEXT N_( \
"The stream will run this duration (in seconds)." )
#define INPUT_LIST_TEXT N_("Input list")
#define INPUT_LIST_TEXT N_("Input list")
#define INPUT_LIST_LONGTEXT N_( \
#define INPUT_LIST_LONGTEXT N_( \
"You can give a comma-separated list " \
"You can give a comma-separated list " \
...
@@ -1454,6 +1458,8 @@ vlc_module_begin();
...
@@ -1454,6 +1458,8 @@ vlc_module_begin();
START_TIME_TEXT
,
START_TIME_LONGTEXT
,
VLC_TRUE
);
START_TIME_TEXT
,
START_TIME_LONGTEXT
,
VLC_TRUE
);
add_integer
(
"stop-time"
,
0
,
NULL
,
add_integer
(
"stop-time"
,
0
,
NULL
,
STOP_TIME_TEXT
,
STOP_TIME_LONGTEXT
,
VLC_TRUE
);
STOP_TIME_TEXT
,
STOP_TIME_LONGTEXT
,
VLC_TRUE
);
add_integer
(
"run-time"
,
0
,
NULL
,
RUN_TIME_TEXT
,
RUN_TIME_LONGTEXT
,
VLC_TRUE
);
add_string
(
"input-list"
,
NULL
,
NULL
,
add_string
(
"input-list"
,
NULL
,
NULL
,
INPUT_LIST_TEXT
,
INPUT_LIST_LONGTEXT
,
VLC_TRUE
);
INPUT_LIST_TEXT
,
INPUT_LIST_LONGTEXT
,
VLC_TRUE
);
add_string
(
"input-slave"
,
NULL
,
NULL
,
add_string
(
"input-slave"
,
NULL
,
NULL
,
...
...
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