Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
1155806b
Commit
1155806b
authored
Oct 21, 2007
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increase rate/speed control granularity.
We now have: 1x 1.5x 2x 3x 4x 8x (and the same for slower).
parent
9c4f520e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
5 deletions
+45
-5
src/input/input.c
src/input/input.c
+45
-5
No files found.
src/input/input.c
View file @
1155806b
...
@@ -1674,12 +1674,52 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type,
...
@@ -1674,12 +1674,52 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type,
{
{
int
i_rate
;
int
i_rate
;
if
(
i_type
==
INPUT_CONTROL_SET_RATE
)
{
i_rate
=
val
.
i_int
;
}
else
{
static
const
int
ppi_factor
[][
2
]
=
{
{
1
,
64
},
{
1
,
32
},
{
1
,
16
},
{
1
,
8
},
{
1
,
4
},
{
1
,
3
},
{
1
,
2
},
{
2
,
3
},
{
1
,
1
},
{
3
,
2
},
{
2
,
1
},
{
3
,
1
},
{
4
,
1
},
{
8
,
1
},
{
16
,
1
},
{
32
,
1
},
{
64
,
1
},
{
0
,
0
}
};
int
i_error
;
int
i_idx
;
int
i
;
i_error
=
INT_MAX
;
i_idx
=
-
1
;
for
(
i
=
0
;
ppi_factor
[
i
][
0
]
!=
0
;
i
++
)
{
const
int
i_test_r
=
INPUT_RATE_DEFAULT
*
ppi_factor
[
i
][
0
]
/
ppi_factor
[
i
][
1
];
const
int
i_test_e
=
abs
(
p_input
->
p
->
i_rate
-
i_test_r
);
if
(
i_test_e
<
i_error
)
{
i_idx
=
i
;
i_error
=
i_test_e
;
}
}
assert
(
i_idx
>=
0
&&
ppi_factor
[
i_idx
][
0
]
!=
0
);
if
(
i_type
==
INPUT_CONTROL_SET_RATE_SLOWER
)
if
(
i_type
==
INPUT_CONTROL_SET_RATE_SLOWER
)
i_rate
=
p_input
->
p
->
i_rate
*
2
;
{
else
if
(
i_type
==
INPUT_CONTROL_SET_RATE_FASTER
)
if
(
ppi_factor
[
i_idx
+
1
][
0
]
>
0
)
i_rate
=
p_input
->
p
->
i_rate
/
2
;
i_rate
=
INPUT_RATE_DEFAULT
*
ppi_factor
[
i_idx
+
1
][
0
]
/
ppi_factor
[
i_idx
+
1
][
1
]
;
else
else
i_rate
=
val
.
i_int
;
i_rate
=
INPUT_RATE_MAX
+
1
;
}
else
{
assert
(
i_type
==
INPUT_CONTROL_SET_RATE_FASTER
);
if
(
i_idx
>
0
)
i_rate
=
INPUT_RATE_DEFAULT
*
ppi_factor
[
i_idx
-
1
][
0
]
/
ppi_factor
[
i_idx
-
1
][
1
];
else
i_rate
=
INPUT_RATE_MIN
-
1
;
}
}
if
(
i_rate
<
INPUT_RATE_MIN
)
if
(
i_rate
<
INPUT_RATE_MIN
)
{
{
...
...
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