atdec: Use gst_audio_decoder_set_output_caps() directly

The code currently sets the same caps in two different ways, and neither of them correctly handle the channel mask.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6157>
This commit is contained in:
Elizabeth Figura 2024-02-20 13:20:12 -06:00 committed by GStreamer Marge Bot
parent bc8a3ca526
commit 277d6ddf22

View file

@ -326,11 +326,7 @@ gst_atdec_set_format (GstAudioDecoder * decoder, GstCaps * caps)
/* set the format we want to negotiate downstream */
gst_audio_info_from_caps (&output_info, output_caps);
gst_audio_info_set_format (&output_info,
output_format.mFormatFlags & kLinearPCMFormatFlagIsSignedInteger ?
GST_AUDIO_FORMAT_S16LE : GST_AUDIO_FORMAT_F32LE,
output_format.mSampleRate, output_format.mChannelsPerFrame, NULL);
gst_audio_decoder_set_output_format (decoder, &output_info);
gst_audio_decoder_set_output_caps (decoder, output_caps);
gst_caps_unref (output_caps);
status = AudioQueueNewOutput (&input_format, gst_atdec_buffer_emptied,