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
c9e0e4e1
Commit
c9e0e4e1
authored
Jun 07, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
control/event.c: Send position event at a reasonable time precision.
parent
da48f25f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
src/control/event.c
src/control/event.c
+17
-10
No files found.
src/control/event.c
View file @
c9e0e4e1
...
...
@@ -39,19 +39,23 @@ static int handle_event( vlc_object_t *p_this, char const *psz_cmd,
* facility for p_data */
struct
libvlc_callback_entry_t
*
entry
=
p_data
;
libvlc_event_t
event
;
event
.
type
=
entry
->
i_event_type
;
switch
(
event
.
type
)
if
(
event
.
type
==
INPUT_POSITION_CHANGED
&&
!
strcmp
(
psz_cmd
,
"intf-change"
))
{
case
VOLUME_CHANGED
:
event
.
value_type
=
BOOLEAN_EVENT
;
break
;
case
INPUT_POSITION_CHANGED
:
break
;
default:
break
;
input_thread_t
*
p_input
=
(
input_thread_t
*
)
p_this
;
vlc_value_t
val
;
var_Get
(
p_input
,
"position"
,
&
val
);
/* Only send event at a reasonable time precision (500ms) */
/* (FIXME: this should be configurable) */
if
((
val
.
i_time
%
I64C
(
500000
))
!=
0
)
{
/* Don't send this event */
return
VLC_SUCCESS
;
}
}
event
.
old_value
=
oldval
;
event
.
new_value
=
newval
;
/* Call the client entry */
entry
->
f_callback
(
entry
->
p_instance
,
&
event
,
entry
->
p_user_data
);
...
...
@@ -95,6 +99,7 @@ static int install_input_event( vlc_object_t *p_this, char const *psz_cmd,
/* FIXME: here we shouldn't listen on intf-change, we have to provide
* in vlc core a more accurate callback */
var_AddCallback
(
p_input
,
"intf-change"
,
handle_event
,
p_listitem
->
elmt
);
var_AddCallback
(
p_input
,
"position"
,
handle_event
,
p_listitem
->
elmt
);
}
}
...
...
@@ -144,6 +149,8 @@ static int remove_variable_callback( libvlc_instance_t *p_instance,
* will be a no-op */
var_DelCallback
(
p_input
,
"intf-change"
,
handle_event
,
p_entry
);
var_DelCallback
(
p_input
,
"position"
,
handle_event
,
p_entry
);
break
;
}
...
...
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