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
b1283c3e
Commit
b1283c3e
authored
Oct 13, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbus: avoid spamming D-Bus with bogus volume/mute changes
parent
a508c29e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
35 deletions
+32
-35
modules/control/dbus/dbus.c
modules/control/dbus/dbus.c
+31
-35
modules/control/dbus/dbus_common.h
modules/control/dbus/dbus_common.h
+1
-0
No files found.
modules/control/dbus/dbus.c
View file @
b1283c3e
...
...
@@ -981,65 +981,61 @@ static int InputCallback( vlc_object_t *p_this, const char *psz_var,
static
int
AllCallback
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
)
{
(
void
)
p_this
;
(
void
)
oldval
;
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_data
;
callback_info_t
*
info
=
calloc
(
1
,
sizeof
(
callback_info_t
)
);
if
(
!
info
)
return
VLC_ENOMEM
;
intf_thread_t
*
p_intf
=
p_data
;
callback_info_t
info
=
{
.
signal
=
SIGNAL_NONE
};
// Wich event is it ?
if
(
!
strcmp
(
"item-current"
,
psz_var
)
)
info
->
signal
=
SIGNAL_ITEM_CURRENT
;
info
.
signal
=
SIGNAL_ITEM_CURRENT
;
else
if
(
!
strcmp
(
"volume"
,
psz_var
)
)
info
->
signal
=
SIGNAL_VOLUME_CHANGE
;
{
if
(
oldval
.
f_float
!=
newval
.
f_float
)
info
.
signal
=
SIGNAL_VOLUME_CHANGE
;
}
else
if
(
!
strcmp
(
"mute"
,
psz_var
)
)
info
->
signal
=
SIGNAL_VOLUME_MUTED
;
{
if
(
oldval
.
b_bool
!=
newval
.
b_bool
)
info
.
signal
=
SIGNAL_VOLUME_MUTED
;
}
else
if
(
!
strcmp
(
"intf-change"
,
psz_var
)
)
info
->
signal
=
SIGNAL_INTF_CHANGE
;
info
.
signal
=
SIGNAL_INTF_CHANGE
;
else
if
(
!
strcmp
(
"playlist-item-append"
,
psz_var
)
)
{
info
->
signal
=
SIGNAL_PLAYLIST_ITEM_APPEND
;
info
->
i_node
=
((
playlist_add_t
*
)
newval
.
p_address
)
->
i_node
;
info
.
signal
=
SIGNAL_PLAYLIST_ITEM_APPEND
;
info
.
i_node
=
((
playlist_add_t
*
)
newval
.
p_address
)
->
i_node
;
}
else
if
(
!
strcmp
(
"playlist-item-deleted"
,
psz_var
)
)
info
->
signal
=
SIGNAL_PLAYLIST_ITEM_DELETED
;
info
.
signal
=
SIGNAL_PLAYLIST_ITEM_DELETED
;
else
if
(
!
strcmp
(
"random"
,
psz_var
)
)
info
->
signal
=
SIGNAL_RANDOM
;
info
.
signal
=
SIGNAL_RANDOM
;
else
if
(
!
strcmp
(
"fullscreen"
,
psz_var
)
)
info
->
signal
=
SIGNAL_FULLSCREEN
;
info
.
signal
=
SIGNAL_FULLSCREEN
;
else
if
(
!
strcmp
(
"repeat"
,
psz_var
)
)
info
->
signal
=
SIGNAL_REPEAT
;
info
.
signal
=
SIGNAL_REPEAT
;
else
if
(
!
strcmp
(
"loop"
,
psz_var
)
)
info
->
signal
=
SIGNAL_LOOP
;
info
.
signal
=
SIGNAL_LOOP
;
else
if
(
!
strcmp
(
"can-seek"
,
psz_var
)
)
info
->
signal
=
SIGNAL_CAN_SEEK
;
info
.
signal
=
SIGNAL_CAN_SEEK
;
else
if
(
!
strcmp
(
"can-pause"
,
psz_var
)
)
info
->
signal
=
SIGNAL_CAN_PAUSE
;
info
.
signal
=
SIGNAL_CAN_PAUSE
;
else
assert
(
0
);
if
(
info
.
signal
==
SIGNAL_NONE
)
return
VLC_SUCCESS
;
callback_info_t
*
p_info
=
malloc
(
sizeof
(
*
p_info
)
);
if
(
unlikely
(
p_info
==
NULL
)
)
return
VLC_ENOMEM
;
// Append the event
*
p_info
=
info
;
vlc_mutex_lock
(
&
p_intf
->
p_sys
->
lock
);
vlc_array_append
(
p_intf
->
p_sys
->
p_events
,
info
);
vlc_array_append
(
p_intf
->
p_sys
->
p_events
,
p_
info
);
vlc_mutex_unlock
(
&
p_intf
->
p_sys
->
lock
);
wakeup_main_loop
(
p_intf
);
(
void
)
p_this
;
return
VLC_SUCCESS
;
}
...
...
modules/control/dbus/dbus_common.h
View file @
b1283c3e
...
...
@@ -108,6 +108,7 @@ struct intf_sys_t
enum
{
SIGNAL_NONE
=
0
,
SIGNAL_ITEM_CURRENT
,
SIGNAL_INTF_CHANGE
,
SIGNAL_PLAYLIST_ITEM_APPEND
,
...
...
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