[vlc-commits] lib: return NAN on libvlc_audio_equalizer_set_amp_at_index() error

Rémi Denis-Courmont git at videolan.org
Tue May 20 13:10:28 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon May 19 19:05:34 2014 +0800| [2e77318cdd4aaf5a14eba144638a15809497496e] | committer: Rémi Denis-Courmont

lib: return NAN on libvlc_audio_equalizer_set_amp_at_index() error

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2e77318cdd4aaf5a14eba144638a15809497496e
---

 include/vlc/libvlc_media_player.h |    2 +-
 lib/audio.c                       |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
index 291343a..4b2f449 100644
--- a/include/vlc/libvlc_media_player.h
+++ b/include/vlc/libvlc_media_player.h
@@ -1833,7 +1833,7 @@ LIBVLC_API int libvlc_audio_equalizer_set_amp_at_index( libvlc_equalizer_t *p_eq
  *
  * \param p_equalizer valid equalizer handle, must not be NULL
  * \param u_band index, counting from zero, of the frequency band to get
- * \return amplification value (Hz); zero if there is no such frequency band
+ * \return amplification value (Hz); NaN if there is no such frequency band
  * \version LibVLC 2.2.0 or later
  */
 LIBVLC_API float libvlc_audio_equalizer_get_amp_at_index( libvlc_equalizer_t *p_equalizer, unsigned u_band );
diff --git a/lib/audio.c b/lib/audio.c
index 26280bd..17939e2 100644
--- a/lib/audio.c
+++ b/lib/audio.c
@@ -621,7 +621,7 @@ int libvlc_audio_equalizer_set_amp_at_index( libvlc_equalizer_t *p_equalizer, fl
 float libvlc_audio_equalizer_get_amp_at_index( libvlc_equalizer_t *p_equalizer, unsigned u_band )
 {
     if ( u_band >= EQZ_BANDS_MAX )
-        return 0.f;
+        return nanf("");
 
     return p_equalizer->f_amp[ u_band ];
 }



More information about the vlc-commits mailing list