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
f607feae
Commit
f607feae
authored
Jun 14, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed "position/time-offset" behaviour.
It fixes the regression when doing close jumps.
parent
7ab9f10d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
30 deletions
+32
-30
src/input/var.c
src/input/var.c
+32
-30
No files found.
src/input/var.c
View file @
f607feae
...
...
@@ -580,31 +580,32 @@ static int PositionCallback( vlc_object_t *p_this, char const *psz_cmd,
void
*
p_data
)
{
input_thread_t
*
p_input
=
(
input_thread_t
*
)
p_this
;
vlc_value_t
val
,
length
;
VLC_UNUSED
(
oldval
);
VLC_UNUSED
(
p_data
);
if
(
!
strcmp
(
psz_cmd
,
"position-offset"
)
)
{
val
.
f_float
=
var_GetFloat
(
p_input
,
"position"
)
+
newval
.
f_float
;
if
(
val
.
f_float
<
0
.
0
)
val
.
f_float
=
0
.
0
;
if
(
val
.
f_float
>
1
.
0
)
val
.
f_float
=
1
.
0
;
input_ControlPush
(
p_input
,
INPUT_CONTROL_SET_POSITION_OFFSET
,
&
newval
);
float
f_position
=
var_GetFloat
(
p_input
,
"position"
)
+
newval
.
f_float
;
if
(
f_position
<
0
.
0
)
f_position
=
0
.
0
;
else
if
(
f_position
>
1
.
0
)
f_position
=
1
.
0
;
var_SetFloat
(
p_this
,
"position"
,
f_position
);
}
else
{
val
.
f_float
=
newval
.
f_float
;
input_ControlPush
(
p_input
,
INPUT_CONTROL_SET_POSITION
,
&
newval
);
}
/* Update "length" for better intf behavour */
const
mtime_t
i_length
=
var_GetTime
(
p_input
,
"length"
);
if
(
i_length
>
0
&&
newval
.
f_float
>=
0
.
0
&&
newval
.
f_float
<=
1
.
0
)
{
vlc_value_t
val
;
/* Update "position" for better intf behavour */
var_Get
(
p_input
,
"length"
,
&
length
);
if
(
length
.
i_time
>
0
&&
val
.
f_float
>=
0
.
0
&&
val
.
f_float
<=
1
.
0
)
{
val
.
i_time
=
length
.
i_time
*
val
.
f_float
;
var_Change
(
p_input
,
"time"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
}
val
.
i_time
=
i_length
*
newval
.
f_float
;
var_Change
(
p_input
,
"time"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
}
/* */
input_ControlPush
(
p_input
,
INPUT_CONTROL_SET_POSITION
,
&
newval
);
}
return
VLC_SUCCESS
;
}
...
...
@@ -612,29 +613,30 @@ 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
;
vlc_value_t
val
,
length
;
VLC_UNUSED
(
oldval
);
VLC_UNUSED
(
p_data
);
if
(
!
strcmp
(
psz_cmd
,
"time-offset"
)
)
{
val
.
i_time
=
var_GetTime
(
p_input
,
"time"
)
+
newval
.
i_time
;
if
(
val
.
i_time
<
0
)
val
.
i_time
=
0
;
input_ControlPush
(
p_input
,
INPUT_CONTROL_SET_TIME_OFFSET
,
&
newval
);
mtime_t
i_time
=
var_GetTime
(
p_input
,
"time"
)
+
newval
.
i_time
;
if
(
i_time
<
0
)
i_time
=
0
;
var_SetTime
(
p_this
,
"time"
,
i_time
);
}
else
{
val
.
i_time
=
newval
.
i_time
;
input_ControlPush
(
p_input
,
INPUT_CONTROL_SET_TIME
,
&
newval
);
}
/* Update "position" for better intf behavour */
const
mtime_t
i_length
=
var_GetTime
(
p_input
,
"length"
);
if
(
i_length
>
0
&&
newval
.
i_time
>=
0
&&
newval
.
i_time
<=
i_length
)
{
vlc_value_t
val
;
/* Update "position" for better intf behavour */
var_Get
(
p_input
,
"length"
,
&
length
);
if
(
length
.
i_time
>
0
&&
val
.
i_time
>=
0
&&
val
.
i_time
<=
length
.
i_time
)
{
val
.
f_float
=
(
double
)
val
.
i_time
/
(
double
)
length
.
i_time
;
var_Change
(
p_input
,
"position"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
}
val
.
f_float
=
(
double
)
newval
.
i_time
/
(
double
)
i_length
;
var_Change
(
p_input
,
"position"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
}
/* */
input_ControlPush
(
p_input
,
INPUT_CONTROL_SET_TIME
,
&
newval
);
}
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