gst-plugins-bad: sndfile: don' t decode formats that are better handled by other elements

Stefan Sauer ensonic at hora-obscura.de
Mon Aug 25 06:58:45 PDT 2014


On 08/25/2014 01:33 PM, Tim MXXller wrote:
> Module: gst-plugins-bad
> Branch: master
> Commit: 8a7079dda9d4c7bae200d7e0324dad8a733946ae
> URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=8a7079dda9d4c7bae200d7e0324dad8a733946ae
>
> Author: Tim-Philipp Müller <tim at centricular.com>
> Date:   Mon Aug 25 12:21:36 2014 +0100
>
> sndfile: don't decode formats that are better handled by other elements
>
> In particular: flac, ogg, pcm, au, aiff, wav.
>
> https://bugzilla.gnome.org/show_bug.cgi?id=722316
>
> ---
>
>  ext/sndfile/gstsf.c |   31 ++++++++++++-------------------
>  1 file changed, 12 insertions(+), 19 deletions(-)
>
> diff --git a/ext/sndfile/gstsf.c b/ext/sndfile/gstsf.c
> index 1370342..ab589bd 100644
> --- a/ext/sndfile/gstsf.c
> +++ b/ext/sndfile/gstsf.c
> @@ -44,30 +44,15 @@ gst_sf_create_audio_template_caps (void)
>      sf_command (NULL, SFC_GET_FORMAT_MAJOR, &format_info, sizeof (format_info));
>  
>      switch (format_info.format) {
> -      case SF_FORMAT_AIFF:     /* Apple/SGI AIFF format */
> -        fmt = "audio/x-aiff";
> -        break;
> -      case SF_FORMAT_AU:       /* Sun/NeXT AU format */
> -        fmt = "audio/x-au";
> -        break;
> -      case SF_FORMAT_FLAC:     /* FLAC lossless file format */
> -        fmt = "audio/x-flac";
> -        break;
>        case SF_FORMAT_IRCAM:    /* Berkeley/IRCAM/CARL */
>          fmt = "audio/x-ircam";
>          break;
>        case SF_FORMAT_NIST:     /* Sphere NIST format. */
>          fmt = "audio/x-nist";
>          break;
> -      case SF_FORMAT_OGG:      /* Xiph OGG container */
> -        fmt = "audio/ogg";
> -        break;
>        case SF_FORMAT_PAF:      /* Ensoniq PARIS file format. */
>          fmt = "audio/x-paris";
>          break;
> -      case SF_FORMAT_RAW:      /* RAW PCM data. */
> -        fmt = "audio/x-raw";
> -        break;
>        case SF_FORMAT_SDS:      /* Midi Sample Dump Standard */
>          fmt = "audio/x-sds";
>          break;
> @@ -77,10 +62,6 @@ gst_sf_create_audio_template_caps (void)
>        case SF_FORMAT_VOC:      /* VOC files. */
>          fmt = "audio/x-voc";
>          break;
> -      case SF_FORMAT_WAV:      /* Microsoft WAV format */
> -      case SF_FORMAT_WAVEX:    /* MS WAVE with WAVEFORMATEX */
> -        fmt = "audio/x-wav";
> -        break;
>        case SF_FORMAT_W64:      /* Sonic Foundry's 64 bit RIFF/WAV */
>          fmt = "audio/x-w64";
>          break;
> @@ -90,6 +71,18 @@ gst_sf_create_audio_template_caps (void)
>        case SF_FORMAT_RF64:     /* RF64 WAV file */
>          fmt = "audio/x-rf64";
>          break;
> +        /* does not make sense to expose that */
> +      case SF_FORMAT_RAW:      /* RAW PCM data. */
> +        /* we have other elements to handle these */
> +      case SF_FORMAT_AIFF:     /* Apple/SGI AIFF format */
> +      case SF_FORMAT_AU:       /* Sun/NeXT AU format */
> +      case SF_FORMAT_FLAC:     /* FLAC lossless file format */
> +      case SF_FORMAT_OGG:      /* Xiph OGG container */
> +      case SF_FORMAT_WAV:      /* Microsoft WAV format */
> +      case SF_FORMAT_WAVEX:    /* MS WAVE with WAVEFORMATEX */
> +        fmt = NULL;
> +        GST_LOG ("skipping format '%s'", format_info.name);
> +        break;
>        case SF_FORMAT_MAT4:     /* Matlab (tm) V4.2 / GNU Octave 2.0 */
>        case SF_FORMAT_MAT5:     /* Matlab (tm) V5.0 / GNU Octave 2.1 */
>        case SF_FORMAT_PVF:      /* Portable Voice Format */
>
Is the lower rank not enough? Whats the exact problem this fixes (it is
not clear from the bug and description to me).
Stefan


More information about the gstreamer-devel mailing list