[vlc-devel] [PATCH] spatialaudio: remove pause hack

Thomas Guillem thomas at gllm.fr
Wed Mar 25 14:16:00 CET 2020


THis is not needed anymore since the PTS is the input one, and not the clock
fixed one.
---
 modules/audio_filter/channel_mixer/spatialaudio.cpp | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/modules/audio_filter/channel_mixer/spatialaudio.cpp b/modules/audio_filter/channel_mixer/spatialaudio.cpp
index 755f1422d5..acb9ed0b75 100644
--- a/modules/audio_filter/channel_mixer/spatialaudio.cpp
+++ b/modules/audio_filter/channel_mixer/spatialaudio.cpp
@@ -88,7 +88,6 @@ struct filter_spatialaudio
     filter_spatialaudio()
         : speakers(NULL)
         , i_inputPTS(0)
-        , i_last_input_pts(0)
         , inBuf(NULL)
         , outBuf(NULL)
     {}
@@ -123,7 +122,6 @@ struct filter_spatialaudio
 
     std::vector<float> inputSamples;
     vlc_tick_t i_inputPTS;
-    vlc_tick_t i_last_input_pts;
     unsigned i_order;
     unsigned i_nondiegetic;
     unsigned i_lr_channels; // number of physical left/right channel pairs
@@ -168,13 +166,6 @@ static block_t *Mix( filter_t *p_filter, block_t *p_buf )
 {
     filter_spatialaudio *p_sys = reinterpret_cast<filter_spatialaudio *>(p_filter->p_sys);
 
-    /* Detect discontinuity due to a pause */
-    static const vlc_tick_t rounding_error = 10;
-    if( p_sys->i_inputPTS != 0
-     && p_buf->i_pts - p_sys->i_last_input_pts > rounding_error )
-        Flush( p_filter );
-    p_sys->i_last_input_pts = p_buf->i_pts + p_buf->i_length;
-
     const size_t i_prevSize = p_sys->inputSamples.size();
     p_sys->inputSamples.resize(i_prevSize + p_buf->i_nb_samples * p_sys->i_inputNb);
     memcpy((char*)(p_sys->inputSamples.data() + i_prevSize), (char*)p_buf->p_buffer, p_buf->i_buffer);
@@ -281,7 +272,7 @@ static void Flush( filter_t *p_filter )
 {
     filter_spatialaudio *p_sys = reinterpret_cast<filter_spatialaudio *>(p_filter->p_sys);
     p_sys->inputSamples.clear();
-    p_sys->i_last_input_pts = p_sys->i_inputPTS = 0;
+    p_sys->i_inputPTS = 0;
 }
 
 static void ChangeViewpoint( filter_t *p_filter, const vlc_viewpoint_t *p_vp)
-- 
2.20.1



More information about the vlc-devel mailing list