Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
f12ce379
Commit
f12ce379
authored
Dec 21, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed fine rate control (hotkeys).
parent
a0c03e33
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
20 deletions
+13
-20
modules/control/hotkeys.c
modules/control/hotkeys.c
+13
-20
No files found.
modules/control/hotkeys.c
View file @
f12ce379
...
...
@@ -719,31 +719,24 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
else
if
(
i_action
==
ACTIONID_RATE_FASTER_FINE
||
i_action
==
ACTIONID_RATE_SLOWER_FINE
)
{
/* The playback rate is defined by INPUT_RATE_DEFAULT / "rate"
* and we want to increase/decrease it by 0.1 while making sure
* that the resulting playback rate is a multiple of 0.1
*/
int
i_rate
=
1
.
*
INPUT_RATE_DEFAULT
/
var_GetFloat
(
p_input
,
"rate"
);
if
(
i_rate
<
INPUT_RATE_MIN
)
i_rate
=
INPUT_RATE_MIN
;
else
if
(
i_rate
>
INPUT_RATE_MAX
)
i_rate
=
INPUT_RATE_MAX
;
int
i_sign
=
i_rate
<
0
?
-
1
:
1
;
const
int
i_dir
=
i_action
==
ACTIONID_RATE_FASTER_FINE
?
1
:
-
1
;
const
double
f_rate_min
=
(
double
)
INPUT_RATE_DEFAULT
/
INPUT_RATE_MAX
;
const
double
f_rate_max
=
(
double
)
INPUT_RATE_DEFAULT
/
INPUT_RATE_MIN
;
double
f_rate
=
var_GetFloat
(
p_input
,
"rate"
);
const
double
f_speed
=
floor
(
(
(
double
)
INPUT_RATE_DEFAULT
/
abs
(
i_rate
)
+
0
.
05
)
/
0
.
1
+
i_dir
)
*
0
.
1
;
if
(
f_speed
<=
(
double
)
INPUT_RATE_DEFAULT
/
INPUT_RATE_MAX
)
/* Needed to avoid infinity */
i_rate
=
INPUT_RATE_MAX
;
else
i_rate
=
INPUT_RATE_DEFAULT
/
f_speed
+
0
.
5
;
int
i_sign
=
f_rate
<
0
?
-
1
:
1
;
const
int
i_dir
=
i_action
==
ACTIONID_RATE_FASTER_FINE
?
1
:
-
1
;
i_rate
=
i_sign
*
__MIN
(
__MAX
(
i_rate
,
INPUT_RATE_MIN
),
INPUT_RATE_MAX
);
f_rate
=
floor
(
fabs
(
f_rate
)
/
0
.
1
+
i_dir
)
*
0
.
1
;
if
(
f_rate
<
f_rate_min
)
f_rate
=
f_rate_min
;
else
if
(
f_rate
>
f_rate_max
)
f_rate
=
f_rate_max
;
f_rate
*=
i_sign
;
var_SetFloat
(
p_input
,
"rate"
,
i
_rate
);
var_SetFloat
(
p_input
,
"rate"
,
f
_rate
);
char
psz_msg
[
7
+
1
];
snprintf
(
psz_msg
,
sizeof
(
psz_msg
),
_
(
"%.2fx"
),
(
double
)
INPUT_RATE_DEFAULT
/
i
_rate
);
snprintf
(
psz_msg
,
sizeof
(
psz_msg
),
_
(
"%.2fx"
),
f
_rate
);
vout_OSDMessage
(
VLC_OBJECT
(
p_input
),
DEFAULT_CHAN
,
"%s"
,
psz_msg
);
}
else
if
(
i_action
==
ACTIONID_POSITION
&&
b_seekable
)
...
...
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