[vlc-commits] amem: fix inconsistency in supported sampling rate

Farid Hammane git at videolan.org
Sun Jan 5 05:38:38 CET 2020


vlc | branch: master | Farid Hammane <farid.hammane at gmail.com> | Fri Jan  3 23:27:10 2020 +0100| [a14b99a1b230771acb675ea81b45763cdb5f2480] | committer: Tristan Matthews

amem: fix inconsistency in supported sampling rate

fixes a consistency issue between the module
descriptor and the test that ensures that the
sample rate is supported.

Signed-off-by: Tristan Matthews <tmatth at videolan.org>

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

 modules/audio_output/amem.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/audio_output/amem.c b/modules/audio_output/amem.c
index 9d21412f07..0e10a86211 100644
--- a/modules/audio_output/amem.c
+++ b/modules/audio_output/amem.c
@@ -30,6 +30,8 @@
 static int Open (vlc_object_t *);
 static void Close (vlc_object_t *);
 
+#define AMEM_SAMPLE_RATE_MAX 384000
+
 vlc_module_begin ()
     set_shortname (N_("Audio memory"))
     set_description (N_("Audio memory output"))
@@ -43,7 +45,7 @@ vlc_module_begin ()
         change_private()
     add_integer ("amem-rate", 44100,
                  N_("Sample rate"), N_("Sample rate"), false)
-        change_integer_range (1, 384000)
+        change_integer_range (1, AMEM_SAMPLE_RATE_MAX)
         change_private()
     add_integer ("amem-channels", 2,
                  N_("Channels count"), N_("Channels count"), false)
@@ -226,7 +228,7 @@ static int Start (audio_output_t *aout, audio_sample_format_t *fmt)
     vlc_mutex_unlock(&sys->lock);
 
     /* Ensure that format is supported */
-    if (fmt->i_rate == 0 || fmt->i_rate > 192000
+    if (fmt->i_rate == 0 || fmt->i_rate > AMEM_SAMPLE_RATE_MAX
      || channels == 0 || channels > AOUT_CHAN_MAX
      || strcmp(format, "S16N") /* TODO: amem-format */)
     {



More information about the vlc-commits mailing list