gboolean fmt_change = FALSE;
GstAudioInfo ainfo;
gint i;
+ GstAudioChannelPosition position[6];
/* see if we need to renegotiate */
if (info->samplerate != faad->samplerate ||
g_free (faad->channel_positions);
faad->channel_positions = g_memdup (info->channel_position, faad->channels);
- /* FIXME: Use the GstAudioInfo of GstAudioDecoder for all of this */
- gst_audio_info_init (&ainfo);
- gst_audio_info_set_format (&ainfo, GST_AUDIO_FORMAT_S16, faad->samplerate,
- faad->channels, NULL);
faad->bps = 16 / 8;
if (!gst_faad_chanpos_to_gst (faad, faad->channel_positions,
GST_DEBUG_OBJECT (faad, "Could not map channel positions");
return FALSE;
}
- memcpy (ainfo.position, faad->aac_positions,
- faad->channels * sizeof (GstAudioChannelPosition));
- gst_audio_channel_positions_to_valid_order (ainfo.position, faad->channels);
- memcpy (faad->gst_positions, ainfo.position,
+
+ memcpy (position, faad->aac_positions, sizeof (position));
+ gst_audio_channel_positions_to_valid_order (position, faad->channels);
+ memcpy (faad->gst_positions, position,
faad->channels * sizeof (GstAudioChannelPosition));
- /* Unset UNPOSITIONED flag */
- if (ainfo.position[0] != GST_AUDIO_CHANNEL_POSITION_NONE)
- ainfo.flags &= ~GST_AUDIO_FLAG_UNPOSITIONED;
/* get the remap table */
memset (faad->reorder_map, 0, sizeof (faad->reorder_map));
}
}
+ /* FIXME: Use the GstAudioInfo of GstAudioDecoder for all of this */
+ gst_audio_info_init (&ainfo);
+ gst_audio_info_set_format (&ainfo, GST_AUDIO_FORMAT_S16, faad->samplerate,
+ faad->channels, position);
+
ret = gst_audio_decoder_set_output_format (GST_AUDIO_DECODER (faad), &ainfo);
return ret;