[vlc-commits] aout: drop remnants of foreign endian support (refs #7764)

Rémi Denis-Courmont git at videolan.org
Wed Dec 19 19:34:25 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Dec 19 20:09:47 2012 +0200| [5ff7862f1380802915bd2d4e4f81966579a1f4a1] | committer: Rémi Denis-Courmont

aout: drop remnants of foreign endian support (refs #7764)

Endianess is now converted by the raw decoder/encoder.

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

 modules/audio_filter/Modules.am         |    2 -
 modules/audio_filter/converter/endian.c |   79 -------------------------------
 po/POTFILES.in                          |    1 -
 src/audio_output/aout_internal.h        |    3 +-
 src/audio_output/common.c               |   40 ----------------
 src/audio_output/filters.c              |   51 ++------------------
 6 files changed, 5 insertions(+), 171 deletions(-)

diff --git a/modules/audio_filter/Modules.am b/modules/audio_filter/Modules.am
index c6d064c..da4626c 100644
--- a/modules/audio_filter/Modules.am
+++ b/modules/audio_filter/Modules.am
@@ -51,12 +51,10 @@ SOURCES_a52tofloat32 = converter/a52tofloat32.c
 SOURCES_dtstospdif = converter/dtstospdif.c
 SOURCES_dtstofloat32 = converter/dtstofloat32.c
 SOURCES_mpgatofixed32 = converter/mpgatofixed32.c
-SOURCES_audio_endian = converter/endian.c
 SOURCES_audio_format = converter/format.c
 
 libvlc_LTLIBRARIES += \
 	liba52tospdif_plugin.la \
-	libaudio_endian_plugin.la \
 	libaudio_format_plugin.la \
 	libdtstospdif_plugin.la
 
diff --git a/modules/audio_filter/converter/endian.c b/modules/audio_filter/converter/endian.c
deleted file mode 100644
index b93015a..0000000
--- a/modules/audio_filter/converter/endian.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*****************************************************************************
- * endian.c : PCM endian converter
- *****************************************************************************
- * Copyright (C) 2002-2005 VLC authors and VideoLAN
- * Copyright (C) 2010 Laurent Aimar
- * Copyright (C) 2012 Rémi Denis-Courmont
- *
- * Authors: Christophe Massiot <massiot at via.ecp.fr>
- *          Gildas Bazin <gbazin at videolan.org>
- *          Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <vlc_common.h>
-#include <vlc_plugin.h>
-#include <vlc_aout.h>
-#include <vlc_block.h>
-#include <vlc_filter.h>
-
-static int  Open(vlc_object_t *);
-
-vlc_module_begin()
-    set_description(N_("Audio filter for endian conversion"))
-    set_category(CAT_AUDIO)
-    set_subcategory(SUBCAT_AUDIO_MISC)
-    set_capability("audio converter", 2)
-    set_callbacks(Open, NULL)
-vlc_module_end()
-
-static const vlc_fourcc_t list[][2] = {
-};
-
-static int Open(vlc_object_t *object)
-{
-    filter_t *filter = (filter_t *)object;
-
-    const audio_sample_format_t *src = &filter->fmt_in.audio;
-    const audio_sample_format_t *dst = &filter->fmt_out.audio;
-
-    if (!AOUT_FMTS_SIMILAR(src, dst))
-        return VLC_EGENERIC;
-
-    for (size_t i = 0; i < sizeof (list) / sizeof (list[0]); i++) {
-        if (src->i_format == list[i][0]) {
-            if (dst->i_format == list[i][1])
-                goto ok;
-            break;
-        }
-        if (src->i_format == list[i][1]) {
-            if (dst->i_format == list[i][0])
-                goto ok;
-            break;
-        }
-    }
-    return VLC_EGENERIC;
-
-ok:
-    switch (src->i_bitspersample) {
-    }
-
-    return VLC_SUCCESS;
-}
diff --git a/po/POTFILES.in b/po/POTFILES.in
index bf0f727..5408e98 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -295,7 +295,6 @@ modules/audio_filter/converter/a52tofloat32.c
 modules/audio_filter/converter/a52tospdif.c
 modules/audio_filter/converter/dtstofloat32.c
 modules/audio_filter/converter/dtstospdif.c
-modules/audio_filter/converter/endian.c
 modules/audio_filter/converter/format.c
 modules/audio_filter/converter/mpgatofixed32.c
 modules/audio_filter/equalizer.c
diff --git a/src/audio_output/aout_internal.h b/src/audio_output/aout_internal.h
index bca1007..cda0e1b 100644
--- a/src/audio_output/aout_internal.h
+++ b/src/audio_output/aout_internal.h
@@ -29,7 +29,7 @@
 /* Max input rate factor (1/4 -> 4) */
 # define AOUT_MAX_INPUT_RATE (4)
 
-# define AOUT_MAX_FILTERS 12
+# define AOUT_MAX_FILTERS 10
 
 enum {
     AOUT_RESAMPLING_NONE=0,
@@ -123,7 +123,6 @@ void aout_OutputDelete( audio_output_t * p_aout );
 
 
 /* From common.c : */
-vlc_fourcc_t aout_NativeEndian(vlc_fourcc_t);
 void aout_FormatsPrint(vlc_object_t *, const char *,
                        const audio_sample_format_t *,
                        const audio_sample_format_t *);
diff --git a/src/audio_output/common.c b/src/audio_output/common.c
index 79c9bc5..3f16894 100644
--- a/src/audio_output/common.c
+++ b/src/audio_output/common.c
@@ -79,46 +79,6 @@ unsigned int aout_BitsPerSample( vlc_fourcc_t i_format )
     }
 }
 
-vlc_fourcc_t aout_NativeEndian( vlc_fourcc_t i_format )
-{
-    switch( i_format )
-    {
-        case VLC_CODEC_F64B:
-        case VLC_CODEC_F64L:
-            return VLC_CODEC_FL64;
-
-        case VLC_CODEC_F32B:
-        case VLC_CODEC_F32L:
-            return VLC_CODEC_FL32;
-
-        case VLC_CODEC_S32B:
-        case VLC_CODEC_S32L:
-            return VLC_CODEC_S32N;
-
-        case VLC_CODEC_U32B:
-        case VLC_CODEC_U32L:
-            return VLC_CODEC_U32N;
-
-        case VLC_CODEC_S24B:
-        case VLC_CODEC_S24L:
-            return VLC_CODEC_S24N;
-
-        case VLC_CODEC_U24B:
-        case VLC_CODEC_U24L:
-            return VLC_CODEC_U24N;
-
-        case VLC_CODEC_S16B:
-        case VLC_CODEC_S16L:
-            return VLC_CODEC_S16N;
-
-        case VLC_CODEC_U16B:
-        case VLC_CODEC_U16L:
-            return VLC_CODEC_U16N;
-    }
-    return 0;
-}
-
-
 /*****************************************************************************
  * aout_FormatPrepare : compute the number of bytes per frame & frame length
  *****************************************************************************/
diff --git a/src/audio_output/filters.c b/src/audio_output/filters.c
index caf7b9a..88f5967 100644
--- a/src/audio_output/filters.c
+++ b/src/audio_output/filters.c
@@ -155,32 +155,9 @@ static int aout_FiltersPipelineCreate(vlc_object_t *obj, filter_t **filters,
     }
     assert (AOUT_FMT_LINEAR(&input));
 
-    bool same_mix = infmt->i_physical_channels == outfmt->i_physical_channels
-                 && infmt->i_original_channels == outfmt->i_original_channels;
-
-    /* Native endianess */
-    if (input.i_format != outfmt->i_format || !same_mix)
-    {
-        vlc_fourcc_t native = aout_NativeEndian (input.i_format);
-        if (native != 0 && native != input.i_format)
-        {
-            if (n == max)
-                goto overflow;
-
-            filter_t *f = TryFormat (obj, native, &input);
-            if (f == NULL)
-            {
-                msg_Err (obj, "cannot find %s for conversion pipeline",
-                         "native endian converter");
-                goto error;
-            }
-
-            filters[n++] = f;
-        }
-    }
-
     /* Remix channels */
-    if (!same_mix)
+    if (infmt->i_physical_channels != outfmt->i_physical_channels
+     || infmt->i_original_channels != outfmt->i_original_channels)
     {   /* Remixing currently requires FL32... TODO: S16N */
         if (input.i_format != VLC_CODEC_FL32)
         {
@@ -242,38 +219,18 @@ static int aout_FiltersPipelineCreate(vlc_object_t *obj, filter_t **filters,
     }
 
     /* Format */
-    vlc_fourcc_t native = aout_NativeEndian (outfmt->i_format);
-    if (native == 0)
-        native = outfmt->i_format;
-    if (input.i_format != native)
+    if (input.i_format != outfmt->i_format)
     {
         if (max == 0)
             goto overflow;
 
-        filter_t *f = TryFormat (obj, native, &input);
-        if (f == NULL)
-        {
-            msg_Err (obj, "cannot find %s for conversion pipeline",
-                     "post-mix converter");
-            goto error;
-        }
-        filters[n++] = f;
-    }
-
-    /* Foreign endianess */
-    if (native != outfmt->i_format)
-    {
-        if (n == max)
-            goto overflow;
-
         filter_t *f = TryFormat (obj, outfmt->i_format, &input);
         if (f == NULL)
         {
             msg_Err (obj, "cannot find %s for conversion pipeline",
-                     "foreign endian converter");
+                     "post-mix converter");
             goto error;
         }
-
         filters[n++] = f;
     }
 



More information about the vlc-commits mailing list