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
2989d4e4
Commit
2989d4e4
authored
Nov 27, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved input requests merging.
parent
9ff8ab10
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
49 deletions
+42
-49
src/input/input.c
src/input/input.c
+42
-49
No files found.
src/input/input.c
View file @
2989d4e4
...
...
@@ -74,7 +74,6 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive );
static
void
ObjectKillChildrens
(
input_thread_t
*
,
vlc_object_t
*
);
static
inline
int
ControlPop
(
input_thread_t
*
,
int
*
,
vlc_value_t
*
,
mtime_t
i_deadline
);
static
void
ControlReduce
(
input_thread_t
*
);
static
void
ControlRelease
(
int
i_type
,
vlc_value_t
val
);
static
bool
Control
(
input_thread_t
*
,
int
,
vlc_value_t
);
...
...
@@ -775,7 +774,6 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
i_deadline
=
__MIN
(
i_intf_update
,
i_statistic_update
);
/* Handle control */
ControlReduce
(
p_input
);
while
(
!
ControlPop
(
p_input
,
&
i_type
,
&
val
,
i_deadline
)
)
{
...
...
@@ -1401,6 +1399,41 @@ void input_ControlPush( input_thread_t *p_input,
vlc_mutex_unlock
(
&
p_input
->
p
->
lock_control
);
}
static
int
ControlGetReducedIndexLocked
(
input_thread_t
*
p_input
)
{
const
int
i_lt
=
p_input
->
p
->
control
[
0
].
i_type
;
int
i
;
for
(
i
=
1
;
i
<
p_input
->
p
->
i_control
;
i
++
)
{
const
int
i_ct
=
p_input
->
p
->
control
[
i
].
i_type
;
if
(
i_lt
==
i_ct
&&
(
i_ct
==
INPUT_CONTROL_SET_STATE
||
i_ct
==
INPUT_CONTROL_SET_RATE
||
i_ct
==
INPUT_CONTROL_SET_POSITION
||
i_ct
==
INPUT_CONTROL_SET_TIME
||
i_ct
==
INPUT_CONTROL_SET_PROGRAM
||
i_ct
==
INPUT_CONTROL_SET_TITLE
||
i_ct
==
INPUT_CONTROL_SET_SEEKPOINT
||
i_ct
==
INPUT_CONTROL_SET_BOOKMARK
)
)
{
continue
;
}
else
{
/* TODO but that's not that important
- merge SET_X with SET_X_CMD
- ignore SET_SEEKPOINT/SET_POSITION/SET_TIME before a SET_TITLE
- ignore SET_SEEKPOINT/SET_POSITION/SET_TIME before another among them
- ?
*/
break
;
}
}
return
i
-
1
;
}
static
inline
int
ControlPop
(
input_thread_t
*
p_input
,
int
*
pi_type
,
vlc_value_t
*
p_val
,
mtime_t
i_deadline
)
...
...
@@ -1425,61 +1458,21 @@ static inline int ControlPop( input_thread_t *p_input,
}
/* */
*
pi_type
=
p_sys
->
control
[
0
].
i_type
;
*
p_val
=
p_sys
->
control
[
0
].
val
;
const
int
i_index
=
ControlGetReducedIndexLocked
(
p_input
);
p_sys
->
i_control
--
;
/* */
*
pi_type
=
p_sys
->
control
[
i_index
].
i_type
;
*
p_val
=
p_sys
->
control
[
i_index
].
val
;
p_sys
->
i_control
-=
i_index
+
1
;
if
(
p_sys
->
i_control
>
0
)
memmove
(
&
p_sys
->
control
[
0
],
&
p_sys
->
control
[
1
],
memmove
(
&
p_sys
->
control
[
0
],
&
p_sys
->
control
[
i_index
+
1
],
sizeof
(
*
p_sys
->
control
)
*
p_sys
->
i_control
);
vlc_mutex_unlock
(
&
p_sys
->
lock_control
);
return
VLC_SUCCESS
;
}
static
void
ControlReduce
(
input_thread_t
*
p_input
)
{
vlc_mutex_lock
(
&
p_input
->
p
->
lock_control
);
for
(
int
i
=
1
;
i
<
p_input
->
p
->
i_control
;
i
++
)
{
const
int
i_lt
=
p_input
->
p
->
control
[
i
-
1
].
i_type
;
const
int
i_ct
=
p_input
->
p
->
control
[
i
].
i_type
;
/* XXX We can't merge INPUT_CONTROL_SET_ES */
/* msg_Dbg( p_input, "[%d/%d] l=%d c=%d", i, p_input->p->i_control,
i_lt, i_ct );
*/
if
(
i_lt
==
i_ct
&&
(
i_ct
==
INPUT_CONTROL_SET_STATE
||
i_ct
==
INPUT_CONTROL_SET_RATE
||
i_ct
==
INPUT_CONTROL_SET_POSITION
||
i_ct
==
INPUT_CONTROL_SET_TIME
||
i_ct
==
INPUT_CONTROL_SET_PROGRAM
||
i_ct
==
INPUT_CONTROL_SET_TITLE
||
i_ct
==
INPUT_CONTROL_SET_SEEKPOINT
||
i_ct
==
INPUT_CONTROL_SET_BOOKMARK
)
)
{
int
j
;
// msg_Dbg( p_input, "merged at %d", i );
/* Remove the i-1 */
for
(
j
=
i
;
j
<
p_input
->
p
->
i_control
;
j
++
)
p_input
->
p
->
control
[
j
-
1
]
=
p_input
->
p
->
control
[
j
];
p_input
->
p
->
i_control
--
;
}
else
{
/* TODO but that's not that important
- merge SET_X with SET_X_CMD
- remove SET_SEEKPOINT/SET_POSITION/SET_TIME before a SET_TITLE
- remove SET_SEEKPOINT/SET_POSITION/SET_TIME before another among them
- ?
*/
}
}
vlc_mutex_unlock
(
&
p_input
->
p
->
lock_control
);
}
static
void
ControlRelease
(
int
i_type
,
vlc_value_t
val
)
{
switch
(
i_type
)
...
...
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