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,
convert->convert = converter_endian;
convert->in_place = TRUE;
switch (GST_AUDIO_INFO_BPS (in_info)) {
case 2:
switch (GST_AUDIO_INFO_WIDTH (in_info)) {
case 16:
GST_DEBUG ("initializing 16-bit endian conversion");
convert->swap_endian = converter_swap_endian_16;
case 3:
case 24:
GST_DEBUG ("initializing 24-bit endian conversion");
convert->swap_endian = converter_swap_endian_24;
case 4:
case 32:
GST_DEBUG ("initializing 32-bit endian conversion");
convert->swap_endian = converter_swap_endian_32;
case 8:
case 64:
GST_DEBUG ("initializing 64-bit endian conversion");
convert->swap_endian = converter_swap_endian_64;
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