+2006-04-20 Tim-Philipp Müller <tim at centricular dot net>
+
+ * gst/matroska/matroska-demux.c: (gst_matroska_demux_audio_caps),
+ (gst_matroska_demux_plugin_init):
+ Make mpeg2 aac audio work: create artificial private codec data
+ chunk which faad2 seems to require, just as we do for mpeg4 aac.
+ Also call gst_riff_init(). Partially fixes #338767.
+
2006-04-19 Tim-Philipp Müller <tim at centricular dot net>
* gst/wavenc/gstwavenc.c: (gst_wavenc_base_init),
/* For AVI compatibility mode... Who did that? */
/* and for fourcc stuff */
+#include <gst/riff/riff-read.h>
#include <gst/riff/riff-ids.h>
#include <gst/riff/riff-media.h>
strlen (GST_MATROSKA_CODEC_ID_AUDIO_MPEG2)) ||
!strncmp (codec_id, GST_MATROSKA_CODEC_ID_AUDIO_MPEG4,
strlen (GST_MATROSKA_CODEC_ID_AUDIO_MPEG4))) {
- gint mpegversion = -1;
GstBuffer *priv = NULL;
+ gint mpegversion = -1;
+ gint rate_idx, profile;
+ guint8 *data;
+
+ /* make up decoderspecificdata */
+ priv = gst_buffer_new_and_alloc (5);
+ data = GST_BUFFER_DATA (priv);
+ rate_idx = aac_rate_idx (audiocontext->samplerate);
+ profile = aac_profile_idx (codec_id);
+
+ data[0] = ((profile + 1) << 3) | ((rate_idx & 0xE) >> 1);
+ data[1] = ((rate_idx & 0x1) << 7) | (audiocontext->channels << 3);
+ GST_BUFFER_SIZE (priv) = 2;
if (!strncmp (codec_id, GST_MATROSKA_CODEC_ID_AUDIO_MPEG2,
- strlen (GST_MATROSKA_CODEC_ID_AUDIO_MPEG2)))
+ strlen (GST_MATROSKA_CODEC_ID_AUDIO_MPEG2))) {
mpegversion = 2;
- else if (!strncmp (codec_id, GST_MATROSKA_CODEC_ID_AUDIO_MPEG4,
+ } else if (!strncmp (codec_id, GST_MATROSKA_CODEC_ID_AUDIO_MPEG4,
strlen (GST_MATROSKA_CODEC_ID_AUDIO_MPEG4))) {
- gint rate_idx, profile;
- guint8 *data;
-
mpegversion = 4;
- /* make up decoderspecificdata */
- priv = gst_buffer_new_and_alloc (5);
- data = GST_BUFFER_DATA (priv);
- rate_idx = aac_rate_idx (audiocontext->samplerate);
- profile = aac_profile_idx (codec_id);
-
- data[0] = ((profile + 1) << 3) | ((rate_idx & 0xE) >> 1);
- data[1] = ((rate_idx & 0x1) << 7) | (audiocontext->channels << 3);
-
if (g_strrstr (codec_id, "SBR")) {
/* HE-AAC (aka SBR AAC) */
audiocontext->samplerate *= 2;
data[2] = AAC_SYNC_EXTENSION_TYPE >> 3;
data[3] = ((AAC_SYNC_EXTENSION_TYPE & 0x07) << 5) | 5;
data[4] = (1 << 7) | (rate_idx << 3);
- } else {
- GST_BUFFER_SIZE (priv) = 2;
+ GST_BUFFER_SIZE (priv) = 5;
}
} else {
g_assert_not_reached ();
gboolean
gst_matroska_demux_plugin_init (GstPlugin * plugin)
{
+ gst_riff_init ();
+
/* create an elementfactory for the matroska_demux element */
if (!gst_element_register (plugin, "matroskademux",
GST_RANK_PRIMARY, GST_TYPE_MATROSKA_DEMUX))