[vlc-commits] trivial: don't do useless mono conversion

Thomas Guillem git at videolan.org
Fri Oct 21 09:41:59 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Oct 21 09:37:58 2016 +0200| [0505f5a767f6191219f0f4b1a307d813ba1476c9] | committer: Thomas Guillem

trivial: don't do useless mono conversion

Like L->R, R->L, L->C, R->C...

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

 modules/audio_filter/channel_mixer/trivial.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/modules/audio_filter/channel_mixer/trivial.c b/modules/audio_filter/channel_mixer/trivial.c
index 7c1e92b..95c6ec8 100644
--- a/modules/audio_filter/channel_mixer/trivial.c
+++ b/modules/audio_filter/channel_mixer/trivial.c
@@ -190,6 +190,12 @@ static block_t *ReverseStereo( filter_t *p_filter, block_t *p_buf )
     return p_buf;
 }
 
+static block_t *Equals( filter_t *p_filter, block_t *p_buf )
+{
+    (void) p_filter;
+    return p_buf;
+}
+
 /**
  * Probes the trivial channel mixer
  */
@@ -249,6 +255,11 @@ static int Create( vlc_object_t *p_this )
             p_filter->pf_audio_filter = ExtractRight;
             return VLC_SUCCESS;
         }
+        if( aout_FormatNbChannels( infmt ) == 1 )
+        {
+            p_filter->pf_audio_filter = Equals;
+            return VLC_SUCCESS;
+        }
     }
 
     p_filter->p_sys = malloc( sizeof(*p_filter->p_sys) );



More information about the vlc-commits mailing list