directsound: AC3/DTS passthrough does not work
There are a couple of issues in directsoundsink when trying to passthrough AC3/DTS.
I am not sure whether there is a bug in gst_audio_iec61937_payload itself or the G_BYTE_ORDER parameter added to the gst_audio_iec61937_payload call is wrong. I haven't really looked into it but changing G_BYTE_ORDER to G_BIG_ENDIAN fixed one part of it.
I am also not sure what gst_buffer_copy_into was supposed to do. IMO it was supposed to copy metadata and not copy the buffer and therefore override what has been created by the gst_audio_iec61937_payload call.
The _swab call swapped infobuf.size amount of data ignoring that the gst_audio_iec61937_payload call actually added a header to it. Maybe after the byte order was added as parameter to gst_audio_iec61937_payload this _swab call is not necessary anymore but IMO this could never have worked.
Attached is a patch that fixes the passthrough for me.