Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
4ad64a60
Commit
4ad64a60
authored
Nov 20, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rate slower/faster in rewind mode.
parent
9a86226f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
11 deletions
+32
-11
modules/demux/live555.cpp
modules/demux/live555.cpp
+0
-2
src/input/input.c
src/input/input.c
+32
-9
No files found.
modules/demux/live555.cpp
View file @
4ad64a60
...
...
@@ -1371,8 +1371,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
p_sys
->
i_pcr
=
0
;
p_sys
->
i_npt
=
0.0
;
es_out_Control
(
p_demux
->
out
,
ES_OUT_RESET_PCR
);
*
pi_int
=
(
int
)(
INPUT_RATE_DEFAULT
/
p_sys
->
ms
->
scale
()
);
msg_Dbg
(
p_demux
,
"PLAY with new Scale %0.2f (%d)"
,
p_sys
->
ms
->
scale
(),
(
*
pi_int
)
);
return
VLC_SUCCESS
;
...
...
src/input/input.c
View file @
4ad64a60
...
...
@@ -1716,10 +1716,13 @@ static bool Control( input_thread_t *p_input, int i_type,
case
INPUT_CONTROL_SET_RATE_FASTER
:
{
int
i_rate
;
int
i_rate_sign
;
/* Get rate and direction */
if
(
i_type
==
INPUT_CONTROL_SET_RATE
)
{
i_rate
=
val
.
i_int
;
i_rate
=
abs
(
val
.
i_int
);
i_rate_sign
=
val
.
i_int
<
0
?
-
1
:
1
;
}
else
{
...
...
@@ -1733,12 +1736,14 @@ static bool Control( input_thread_t *p_input, int i_type,
int
i_idx
;
int
i
;
i_rate_sign
=
p_input
->
p
->
i_rate
<
0
?
-
1
:
1
;
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
);
const
int
i_test_e
=
abs
(
abs
(
p_input
->
p
->
i_rate
)
-
i_test_r
);
if
(
i_test_e
<
i_error
)
{
i_idx
=
i
;
...
...
@@ -1765,12 +1770,8 @@ static bool Control( input_thread_t *p_input, int i_type,
}
}
if
(
i_rate
<
0
&&
p_input
->
p
->
input
.
b_rescale_ts
)
{
msg_Dbg
(
p_input
,
"cannot set negative rate"
);
i_rate
=
INPUT_RATE_MIN
;
}
else
if
(
i_rate
>
0
&&
i_rate
<
INPUT_RATE_MIN
)
/* Check rate bound */
if
(
i_rate
<
INPUT_RATE_MIN
)
{
msg_Dbg
(
p_input
,
"cannot set rate faster"
);
i_rate
=
INPUT_RATE_MIN
;
...
...
@@ -1780,6 +1781,22 @@ static bool Control( input_thread_t *p_input, int i_type,
msg_Dbg
(
p_input
,
"cannot set rate slower"
);
i_rate
=
INPUT_RATE_MAX
;
}
/* Apply direction */
if
(
i_rate_sign
<
0
)
{
if
(
p_input
->
p
->
input
.
b_rescale_ts
)
{
msg_Dbg
(
p_input
,
"cannot set negative rate"
);
i_rate
=
p_input
->
p
->
i_rate
;
assert
(
i_rate
>
0
);
}
else
{
i_rate
*=
i_rate_sign
;
}
}
if
(
i_rate
!=
INPUT_RATE_DEFAULT
&&
(
(
!
p_input
->
p
->
b_can_rate_control
&&
!
p_input
->
p
->
input
.
b_rescale_ts
)
||
(
p_input
->
p
->
p_sout
&&
!
p_input
->
p
->
b_out_pace_control
)
)
)
...
...
@@ -1792,10 +1809,17 @@ static bool Control( input_thread_t *p_input, int i_type,
{
int
i_ret
;
if
(
p_input
->
p
->
input
.
p_access
)
{
i_ret
=
VLC_EGENERIC
;
}
else
{
if
(
!
p_input
->
p
->
input
.
b_rescale_ts
)
es_out_Control
(
p_input
->
p
->
p_es_out
,
ES_OUT_RESET_PCR
);
i_ret
=
demux_Control
(
p_input
->
p
->
input
.
p_demux
,
DEMUX_SET_RATE
,
&
i_rate
);
}
if
(
i_ret
)
{
msg_Warn
(
p_input
,
"ACCESS/DEMUX_SET_RATE failed"
);
...
...
@@ -1812,7 +1836,6 @@ static bool Control( input_thread_t *p_input, int i_type,
p_input
->
p
->
i_rate
=
i_rate
;
/* FIXME do we need a RESET_PCR when !p_input->p->input.b_rescale_ts ? */
if
(
p_input
->
p
->
input
.
b_rescale_ts
)
{
const
int
i_rate_source
=
(
p_input
->
b_can_pace_control
||
p_input
->
p
->
b_can_rate_control
)
?
i_rate
:
INPUT_RATE_DEFAULT
;
...
...
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