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
a88db786
Commit
a88db786
authored
May 05, 2008
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DBus: Round volume to nearest integer - fixes #1561
parent
ed57b5bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
configure.ac
configure.ac
+3
-0
modules/control/dbus.c
modules/control/dbus.c
+6
-2
No files found.
configure.ac
View file @
a88db786
...
@@ -637,6 +637,9 @@ AC_CHECK_LIB(m,ceil,[
...
@@ -637,6 +637,9 @@ AC_CHECK_LIB(m,ceil,[
AC_CHECK_LIB(m,exp,[
AC_CHECK_LIB(m,exp,[
VLC_ADD_LIBS([gaussianblur],[-lm])
VLC_ADD_LIBS([gaussianblur],[-lm])
])
])
AC_CHECK_LIB(m,round,[
VLC_ADD_LIBS([dbus],[-lm])
])
AC_CHECK_LIB(mx,sqrtf,[
AC_CHECK_LIB(mx,sqrtf,[
VLC_ADD_LIBS([x264],[-lmx])
VLC_ADD_LIBS([x264],[-lmx])
])
])
...
...
modules/control/dbus.c
View file @
a88db786
...
@@ -54,6 +54,8 @@
...
@@ -54,6 +54,8 @@
#include <vlc_input.h>
#include <vlc_input.h>
#include <vlc_playlist.h>
#include <vlc_playlist.h>
#include <math.h>
/*****************************************************************************
/*****************************************************************************
* Local prototypes.
* Local prototypes.
*****************************************************************************/
*****************************************************************************/
...
@@ -221,7 +223,8 @@ DBUS_METHOD( VolumeGet )
...
@@ -221,7 +223,8 @@ DBUS_METHOD( VolumeGet )
audio_volume_t
i_vol
;
audio_volume_t
i_vol
;
/* 2nd argument of aout_VolumeGet is int32 */
/* 2nd argument of aout_VolumeGet is int32 */
aout_VolumeGet
(
(
vlc_object_t
*
)
p_this
,
&
i_vol
);
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
);
ADD_INT32
(
&
i_dbus_vol
);
REPLY_SEND
;
REPLY_SEND
;
}
}
...
@@ -248,7 +251,8 @@ DBUS_METHOD( VolumeSet )
...
@@ -248,7 +251,8 @@ DBUS_METHOD( VolumeSet )
return
DBUS_HANDLER_RESULT_NOT_YET_HANDLED
;
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
);
aout_VolumeSet
(
(
vlc_object_t
*
)
p_this
,
i_vol
);
REPLY_SEND
;
REPLY_SEND
;
...
...
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