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
aaf888a6
Commit
aaf888a6
authored
Mar 23, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cosmetics.
parent
c6a829ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
21 deletions
+29
-21
src/input/input.c
src/input/input.c
+17
-14
src/input/input_internal.h
src/input/input_internal.h
+12
-7
No files found.
src/input/input.c
View file @
aaf888a6
...
@@ -320,8 +320,10 @@ static void Destructor( input_thread_t * p_input )
...
@@ -320,8 +320,10 @@ static void Destructor( input_thread_t * p_input )
vlc_mutex_destroy
(
&
p_input
->
p
->
counters
.
counters_lock
);
vlc_mutex_destroy
(
&
p_input
->
p
->
counters
.
counters_lock
);
for
(
int
i
=
0
;
i
<
p_input
->
p
->
i_control
;
i
++
)
for
(
int
i
=
0
;
i
<
p_input
->
p
->
i_control
;
i
++
)
ControlRelease
(
p_input
->
p
->
control
[
i
].
i_type
,
{
p_input
->
p
->
control
[
i
].
val
);
input_control_t
*
p_ctrl
=
&
p_input
->
p
->
control
[
i
];
ControlRelease
(
p_ctrl
->
i_type
,
p_ctrl
->
val
);
}
vlc_cond_destroy
(
&
p_input
->
p
->
wait_control
);
vlc_cond_destroy
(
&
p_input
->
p
->
wait_control
);
vlc_mutex_destroy
(
&
p_input
->
p
->
lock_control
);
vlc_mutex_destroy
(
&
p_input
->
p
->
lock_control
);
...
@@ -1370,15 +1372,16 @@ void input_ControlPush( input_thread_t *p_input,
...
@@ -1370,15 +1372,16 @@ void input_ControlPush( input_thread_t *p_input,
vlc_mutex_lock
(
&
p_input
->
p
->
lock_control
);
vlc_mutex_lock
(
&
p_input
->
p
->
lock_control
);
if
(
i_type
==
INPUT_CONTROL_SET_DIE
)
if
(
i_type
==
INPUT_CONTROL_SET_DIE
)
{
{
for
(
int
i
=
0
;
i
<
p_input
->
p
->
i_control
;
i
++
)
ControlRelease
(
p_input
->
p
->
control
[
i
].
i_type
,
p_input
->
p
->
control
[
i
].
val
);
/* Special case, empty the control */
/* Special case, empty the control */
p_input
->
p
->
i_control
=
1
;
for
(
int
i
=
0
;
i
<
p_input
->
p
->
i_control
;
i
++
)
p_input
->
p
->
control
[
0
].
i_type
=
i_type
;
{
memset
(
&
p_input
->
p
->
control
[
0
].
val
,
0
,
sizeof
(
vlc_value_t
)
);
input_control_t
*
p_ctrl
=
&
p_input
->
p
->
control
[
i
];
ControlRelease
(
p_ctrl
->
i_type
,
p_ctrl
->
val
);
}
p_input
->
p
->
i_control
=
0
;
}
}
else
if
(
p_input
->
p
->
i_control
>=
INPUT_CONTROL_FIFO_SIZE
)
if
(
p_input
->
p
->
i_control
>=
INPUT_CONTROL_FIFO_SIZE
)
{
{
msg_Err
(
p_input
,
"input control fifo overflow, trashing type=%d"
,
msg_Err
(
p_input
,
"input control fifo overflow, trashing type=%d"
,
i_type
);
i_type
);
...
@@ -1387,14 +1390,14 @@ void input_ControlPush( input_thread_t *p_input,
...
@@ -1387,14 +1390,14 @@ void input_ControlPush( input_thread_t *p_input,
}
}
else
else
{
{
p_input
->
p
->
control
[
p_input
->
p
->
i_control
].
i_type
=
i_type
;
input_control_t
c
;
c
.
i_type
=
i_type
;
if
(
p_val
)
if
(
p_val
)
p_input
->
p
->
control
[
p_input
->
p
->
i_control
]
.
val
=
*
p_val
;
c
.
val
=
*
p_val
;
else
else
memset
(
&
p_input
->
p
->
control
[
p_input
->
p
->
i_control
].
val
,
0
,
memset
(
&
c
,
0
,
sizeof
(
c
)
);
sizeof
(
vlc_value_t
)
);
p_input
->
p
->
i_control
++
;
p_input
->
p
->
control
[
p_input
->
p
->
i_control
++
]
=
c
;
}
}
vlc_cond_signal
(
&
p_input
->
p
->
wait_control
);
vlc_cond_signal
(
&
p_input
->
p
->
wait_control
);
vlc_mutex_unlock
(
&
p_input
->
p
->
lock_control
);
vlc_mutex_unlock
(
&
p_input
->
p
->
lock_control
);
...
...
src/input/input_internal.h
View file @
aaf888a6
...
@@ -75,6 +75,12 @@ typedef struct
...
@@ -75,6 +75,12 @@ typedef struct
}
input_source_t
;
}
input_source_t
;
typedef
struct
{
int
i_type
;
vlc_value_t
val
;
}
input_control_t
;
/** Private input fields */
/** Private input fields */
struct
input_thread_private_t
struct
input_thread_private_t
{
{
...
@@ -158,13 +164,8 @@ struct input_thread_private_t
...
@@ -158,13 +164,8 @@ struct input_thread_private_t
vlc_mutex_t
lock_control
;
vlc_mutex_t
lock_control
;
vlc_cond_t
wait_control
;
vlc_cond_t
wait_control
;
int
i_control
;
int
i_control
;
struct
input_control_t
control
[
INPUT_CONTROL_FIFO_SIZE
];
{
/* XXX for string value you have to allocate it before calling
* input_ControlPush */
int
i_type
;
vlc_value_t
val
;
}
control
[
INPUT_CONTROL_FIFO_SIZE
];
bool
b_abort
;
bool
b_abort
;
};
};
...
@@ -215,6 +216,10 @@ enum input_control_e
...
@@ -215,6 +216,10 @@ enum input_control_e
};
};
/* Internal helpers */
/* Internal helpers */
/* XXX for string value you have to allocate it before calling
* input_ControlPush
*/
void
input_ControlPush
(
input_thread_t
*
,
int
i_type
,
vlc_value_t
*
);
void
input_ControlPush
(
input_thread_t
*
,
int
i_type
,
vlc_value_t
*
);
/**********************************************************************
/**********************************************************************
...
...
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