[vlc-commits] aout: convert audio output "volume" to float
Rémi Denis-Courmont
git at videolan.org
Thu Jul 19 19:42:02 CEST 2012
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jul 19 20:33:26 2012 +0300| [01205ea1f2da1a330ede9b3757e0aae6164e4cfb] | committer: Rémi Denis-Courmont
aout: convert audio output "volume" to float
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=01205ea1f2da1a330ede9b3757e0aae6164e4cfb
---
src/audio_output/common.c | 2 +-
src/audio_output/intf.c | 4 ++--
src/audio_output/output.c | 6 +-----
3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/audio_output/common.c b/src/audio_output/common.c
index 4907ba4..06b205c 100644
--- a/src/audio_output/common.c
+++ b/src/audio_output/common.c
@@ -73,7 +73,7 @@ audio_output_t *aout_New( vlc_object_t * p_parent )
vlc_value_t val, text;
char *str;
- var_Create (aout, "volume", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
+ var_Create (aout, "volume", VLC_VAR_FLOAT);
var_Create (aout, "mute", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
/* Visualizations */
diff --git a/src/audio_output/intf.c b/src/audio_output/intf.c
index 9f0fef8..8726b62 100644
--- a/src/audio_output/intf.c
+++ b/src/audio_output/intf.c
@@ -72,9 +72,9 @@ float aout_VolumeGet (vlc_object_t *obj)
if (aout == NULL)
return -1.f;
- long l = var_InheritInteger (aout, "volume");
+ float volume = var_GetFloat (aout, "volume");
vlc_object_release (aout);
- return l / (float)AOUT_VOLUME_DEFAULT;
+ return volume;
}
#undef aout_VolumeSet
diff --git a/src/audio_output/output.c b/src/audio_output/output.c
index 4525867..1a903cb 100644
--- a/src/audio_output/output.c
+++ b/src/audio_output/output.c
@@ -91,11 +91,7 @@ static void aout_OutputTimeReport (audio_output_t *aout, mtime_t ideal)
*/
static void aout_OutputVolumeReport (audio_output_t *aout, float volume)
{
- long vol = lroundf (volume * (float)AOUT_VOLUME_DEFAULT);
-
- /* We cannot acquire the volume lock as this gets called from the audio
- * output plug-in (it would cause a lock inversion). */
- var_SetInteger (aout, "volume", vol);
+ var_SetFloat (aout, "volume", volume);
}
static void aout_OutputMuteReport (audio_output_t *aout, bool mute)
More information about the vlc-commits
mailing list