Commit a54dbec4 authored by Marouen Ghodhbane's avatar Marouen Ghodhbane Committed by Tim-Philipp Müller

audio-convert: Fix endianness conversion function init

Endianness conversion should be based on the sample width instead of the
sample depth.

Fixes #510
parent 35885397
...@@ -1253,20 +1253,20 @@ gst_audio_converter_new (GstAudioConverterFlags flags, GstAudioInfo * in_info, ...@@ -1253,20 +1253,20 @@ gst_audio_converter_new (GstAudioConverterFlags flags, GstAudioInfo * in_info,
convert->convert = converter_endian; convert->convert = converter_endian;
convert->in_place = TRUE; convert->in_place = TRUE;
switch (GST_AUDIO_INFO_BPS (in_info)) { switch (GST_AUDIO_INFO_WIDTH (in_info)) {
case 2: case 16:
GST_DEBUG ("initializing 16-bit endian conversion"); GST_DEBUG ("initializing 16-bit endian conversion");
convert->swap_endian = converter_swap_endian_16; convert->swap_endian = converter_swap_endian_16;
break; break;
case 3: case 24:
GST_DEBUG ("initializing 24-bit endian conversion"); GST_DEBUG ("initializing 24-bit endian conversion");
convert->swap_endian = converter_swap_endian_24; convert->swap_endian = converter_swap_endian_24;
break; break;
case 4: case 32:
GST_DEBUG ("initializing 32-bit endian conversion"); GST_DEBUG ("initializing 32-bit endian conversion");
convert->swap_endian = converter_swap_endian_32; convert->swap_endian = converter_swap_endian_32;
break; break;
case 8: case 64:
GST_DEBUG ("initializing 64-bit endian conversion"); GST_DEBUG ("initializing 64-bit endian conversion");
convert->swap_endian = converter_swap_endian_64; convert->swap_endian = converter_swap_endian_64;
break; break;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment