Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
a88db786
Commit
a88db786
authored
May 05, 2008
by
Rafaël Carré
Browse files
DBus: Round volume to nearest integer - fixes #1561
parent
ed57b5bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
a88db786
...
...
@@ -637,6 +637,9 @@ AC_CHECK_LIB(m,ceil,[
AC_CHECK_LIB(m,exp,[
VLC_ADD_LIBS([gaussianblur],[-lm])
])
AC_CHECK_LIB(m,round,[
VLC_ADD_LIBS([dbus],[-lm])
])
AC_CHECK_LIB(mx,sqrtf,[
VLC_ADD_LIBS([x264],[-lmx])
])
...
...
modules/control/dbus.c
View file @
a88db786
...
...
@@ -54,6 +54,8 @@
#include
<vlc_input.h>
#include
<vlc_playlist.h>
#include
<math.h>
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
...
...
@@ -221,7 +223,8 @@ DBUS_METHOD( VolumeGet )
audio_volume_t
i_vol
;
/* 2nd argument of aout_VolumeGet is int32 */
aout_VolumeGet
(
(
vlc_object_t
*
)
p_this
,
&
i_vol
);
i_dbus_vol
=
(
100
*
i_vol
)
/
AOUT_VOLUME_MAX
;
double
f_vol
=
100
.
*
i_vol
/
AOUT_VOLUME_MAX
;
i_dbus_vol
=
round
(
f_vol
);
ADD_INT32
(
&
i_dbus_vol
);
REPLY_SEND
;
}
...
...
@@ -248,7 +251,8 @@ DBUS_METHOD( VolumeSet )
return
DBUS_HANDLER_RESULT_NOT_YET_HANDLED
;
}
i_vol
=
(
AOUT_VOLUME_MAX
/
100
)
*
i_dbus_vol
;
double
f_vol
=
AOUT_VOLUME_MAX
*
i_dbus_vol
/
100
.;
i_vol
=
round
(
f_vol
);
aout_VolumeSet
(
(
vlc_object_t
*
)
p_this
,
i_vol
);
REPLY_SEND
;
...
...
Write
Preview
Supports
Markdown
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