qtdemux: set alac caps using info from codec buffer

The samplerate field in the STSD atom is not right for some ALAC files
(usually when audio is 96kHz/24bits), so the audio caps must be
extracted from the codec data.

https://bugzilla.gnome.org/show_bug.cgi?id=700382
This commit is contained in:
Arnaud Vrac 2013-05-14 15:23:08 +02:00 committed by Tim-Philipp Müller
parent 8ed611cdbc
commit 6edcc564ba

View file

@ -7805,6 +7805,7 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
alac = qtdemux_tree_get_child_by_type (alac, FOURCC_alac);
}
if (alac) {
const guint8 *alac_data = alac->data;
gint len = QT_UINT32 (alac->data);
GstBuffer *buf;
@ -7819,6 +7820,10 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
gst_caps_set_simple (stream->caps,
"codec_data", GST_TYPE_BUFFER, buf, NULL);
gst_buffer_unref (buf);
stream->bytes_per_frame = QT_UINT32 (alac_data + 12);
stream->n_channels = QT_UINT8 (alac_data + 21);
stream->rate = QT_UINT32 (alac_data + 32);
}
}
gst_caps_set_simple (stream->caps,