[vlc-devel] [PATCH 10/17] Audio mixer: Audio frames are now vlc_frame_t

Denis Charmet typx at dinauz.org
Mon Apr 22 19:10:39 CEST 2019


---
 modules/audio_mixer/float.c   |  4 ++--
 modules/audio_mixer/integer.c | 18 +++++++++---------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/modules/audio_mixer/float.c b/modules/audio_mixer/float.c
index a747ceb47e..3f1c8a58a3 100644
--- a/modules/audio_mixer/float.c
+++ b/modules/audio_mixer/float.c
@@ -53,7 +53,7 @@ vlc_module_end ()
 /**
  * Mixes a new output buffer
  */
-static void FilterFL32( audio_volume_t *p_volume, block_t *p_buffer,
+static void FilterFL32( audio_volume_t *p_volume, vlc_frame_t *p_buffer,
                         float f_multiplier )
 {
     if( f_multiplier == 1.f )
@@ -66,7 +66,7 @@ static void FilterFL32( audio_volume_t *p_volume, block_t *p_buffer,
     (void) p_volume;
 }
 
-static void FilterFL64( audio_volume_t *p_volume, block_t *p_buffer,
+static void FilterFL64( audio_volume_t *p_volume, vlc_frame_t *p_buffer,
                         float f_multiplier )
 {
     double *p = (double *)p_buffer->p_buffer;
diff --git a/modules/audio_mixer/integer.c b/modules/audio_mixer/integer.c
index 73f3f0303e..1786e5127f 100644
--- a/modules/audio_mixer/integer.c
+++ b/modules/audio_mixer/integer.c
@@ -40,15 +40,15 @@ vlc_module_begin ()
     set_callbacks (Activate, NULL)
 vlc_module_end ()
 
-static void FilterS32N (audio_volume_t *vol, block_t *block, float volume)
+static void FilterS32N (audio_volume_t *vol, vlc_frame_t *frame, float volume)
 {
-    int32_t *p = (int32_t *)block->p_buffer;
+    int32_t *p = (int32_t *)frame->p_buffer;
 
     int_fast32_t mult = lroundf (volume * 0x1.p24f);
     if (mult == (1 << 24))
         return;
 
-    for (size_t n = block->i_buffer / sizeof (*p); n > 0; n--)
+    for (size_t n = frame->i_buffer / sizeof (*p); n > 0; n--)
     {
         int_fast64_t s = (*p * (int_fast64_t)mult) >> INT64_C(24);
         if (s > INT32_MAX)
@@ -61,15 +61,15 @@ static void FilterS32N (audio_volume_t *vol, block_t *block, float volume)
     (void) vol;
 }
 
-static void FilterS16N (audio_volume_t *vol, block_t *block, float volume)
+static void FilterS16N (audio_volume_t *vol, vlc_frame_t *frame, float volume)
 {
-    int16_t *p = (int16_t *)block->p_buffer;
+    int16_t *p = (int16_t *)frame->p_buffer;
 
     int_fast16_t mult = lroundf (volume * 0x1.p8f);
     if (mult == (1 << 8))
         return;
 
-    for (size_t n = block->i_buffer / sizeof (*p); n > 0; n--)
+    for (size_t n = frame->i_buffer / sizeof (*p); n > 0; n--)
     {
         int_fast32_t s = (*p * (int_fast32_t)mult) >> 8;
         if (s > INT16_MAX)
@@ -82,15 +82,15 @@ static void FilterS16N (audio_volume_t *vol, block_t *block, float volume)
     (void) vol;
 }
 
-static void FilterU8 (audio_volume_t *vol, block_t *block, float volume)
+static void FilterU8 (audio_volume_t *vol, vlc_frame_t *frame, float volume)
 {
-    uint8_t *p = (uint8_t *)block->p_buffer;
+    uint8_t *p = (uint8_t *)frame->p_buffer;
 
     int_fast16_t mult = lroundf (volume * 0x1.p8f);
     if (mult == (1 << 8))
         return;
 
-    for (size_t n = block->i_buffer / sizeof (*p); n > 0; n--)
+    for (size_t n = frame->i_buffer / sizeof (*p); n > 0; n--)
     {
         int_fast32_t s = (((int_fast8_t)(*p - 128)) * (int_fast32_t)mult) >> 8;
         if (s > INT8_MAX)
-- 
2.20.1



More information about the vlc-devel mailing list