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
50f7bdc9
Commit
50f7bdc9
authored
Sep 20, 2003
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* input: added position-offset and time-offset for relative seeking.
(Untested)
parent
47d57d6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
6 deletions
+34
-6
src/input/input.c
src/input/input.c
+34
-6
No files found.
src/input/input.c
View file @
50f7bdc9
...
...
@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: input.c,v 1.24
1 2003/09/15 18:05:13
fenrir Exp $
* $Id: input.c,v 1.24
2 2003/09/20 13:50:14
fenrir Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -119,13 +119,15 @@ input_thread_t *__input_CreateThread( vlc_object_t *p_parent,
/* play status */
/* position variable */
var_Create
(
p_input
,
"position"
,
VLC_VAR_FLOAT
);
/* position 0.0 -> 1.0 */
var_Create
(
p_input
,
"position"
,
VLC_VAR_FLOAT
);
/* position 0.0->1.0 */
var_Create
(
p_input
,
"position-offset"
,
VLC_VAR_FLOAT
);
/* relative */
val
.
f_float
=
0
.
0
;
var_Change
(
p_input
,
"position"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
var_AddCallback
(
p_input
,
"position"
,
PositionCallback
,
NULL
);
/* time variable */
var_Create
(
p_input
,
"time"
,
VLC_VAR_TIME
);
var_Create
(
p_input
,
"time-offset"
,
VLC_VAR_TIME
);
/* relative */
val
.
i_time
=
0
;
var_Change
(
p_input
,
"time"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
var_AddCallback
(
p_input
,
"time"
,
TimeCallback
,
NULL
);
...
...
@@ -1189,14 +1191,27 @@ static int PositionCallback( vlc_object_t *p_this, char const *psz_cmd,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
)
{
input_thread_t
*
p_input
=
(
input_thread_t
*
)
p_this
;
int64_t
i_offset
;
msg_Warn
(
p_input
,
"cmd=%s old=%f new=%f"
,
psz_cmd
,
oldval
.
f_float
,
newval
.
f_float
);
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
p_input
->
stream
.
p_selected_area
->
i_seek
=
(
int64_t
)(
newval
.
f_float
*
(
double
)
p_input
->
stream
.
p_selected_area
->
i_size
);
i_offset
=
(
int64_t
)(
newval
.
f_float
*
(
double
)
p_input
->
stream
.
p_selected_area
->
i_size
);
if
(
!
strcmp
(
psz_cmd
,
"position-offset"
)
)
{
p_input
->
stream
.
p_selected_area
->
i_seek
+=
i_offset
;
}
else
{
p_input
->
stream
.
p_selected_area
->
i_seek
=
i_offset
;
}
if
(
p_input
->
stream
.
p_selected_area
->
i_seek
<
0
)
{
p_input
->
stream
.
p_selected_area
->
i_seek
=
0
;
}
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
return
VLC_SUCCESS
;
...
...
@@ -1206,15 +1221,28 @@ static int TimeCallback ( vlc_object_t *p_this, char const *psz_cmd,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
)
{
input_thread_t
*
p_input
=
(
input_thread_t
*
)
p_this
;
int64_t
i_offset
;
/* FIXME TODO FIXME */
msg_Warn
(
p_input
,
"cmd=%s old=%lld new=%lld"
,
psz_cmd
,
oldval
.
i_time
,
newval
.
i_time
);
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
p_input
->
stream
.
p_selected_area
->
i_seek
=
newval
.
i_time
/
1000000
*
50
*
p_input
->
stream
.
i_mux_rate
;
i_offset
=
newval
.
i_time
/
1000000
*
50
*
p_input
->
stream
.
i_mux_rate
;
if
(
!
strcmp
(
psz_cmd
,
"time-offset"
)
)
{
p_input
->
stream
.
p_selected_area
->
i_seek
+=
i_offset
;
}
else
{
p_input
->
stream
.
p_selected_area
->
i_seek
=
i_offset
;
}
if
(
p_input
->
stream
.
p_selected_area
->
i_seek
<
0
)
{
p_input
->
stream
.
p_selected_area
->
i_seek
=
0
;
}
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
return
VLC_SUCCESS
;
...
...
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