mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 20:05:38 +00:00
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:
parent
8ed611cdbc
commit
6edcc564ba
1 changed files with 5 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue