summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2008-12-06 19:46:05 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2008-12-06 19:46:05 +0000
commitf4cb76e92dc78bdde3dd9be49fc921111a94ee0a (patch)
tree270c5059eb61ef87700ebaa95919acdfdbf6afd2
parent6f15343df11bdd3b39ede05158f0f8e7f1fdca62 (diff)
downloadgst-plugins-bad-f4cb76e92dc78bdde3dd9be49fc921111a94ee0a.tar.gz
gst-plugins-bad-f4cb76e92dc78bdde3dd9be49fc921111a94ee0a.tar.bz2
gst-plugins-bad-f4cb76e92dc78bdde3dd9be49fc921111a94ee0a.zip
gst/mxf/mxfd10.c: Document decoding of the AES3 data and also skip the 32 bit header in the beginning of every buffer...
Original commit message from CVS: * gst/mxf/mxfd10.c: (mxf_d10_sound_handle_essence_element): Document decoding of the AES3 data and also skip the 32 bit header in the beginning of every buffer, otherwise we get one broken audio channel.
-rw-r--r--ChangeLog7
-rw-r--r--gst/mxf/mxfd10.c8
2 files changed, 15 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index e1a8f65b..6c35fbce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-12-06 Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
+ * gst/mxf/mxfd10.c: (mxf_d10_sound_handle_essence_element):
+ Document decoding of the AES3 data and also skip the 32 bit
+ header in the beginning of every buffer, otherwise we get
+ one broken audio channel.
+
2008-12-05 Sebastian Dröge <sebastian.droege@collabora.co.uk>
* gst/mxf/mxfdemux.c: (gst_mxf_demux_reset_metadata),
diff --git a/gst/mxf/mxfd10.c b/gst/mxf/mxfd10.c
index 75e74008..d8d19099 100644
--- a/gst/mxf/mxfd10.c
+++ b/gst/mxf/mxfd10.c
@@ -118,10 +118,16 @@ mxf_d10_sound_handle_essence_element (const MXFUL * key, GstBuffer * buffer,
indata = GST_BUFFER_DATA (buffer);
outdata = GST_BUFFER_DATA (*outbuf);
+ /* Skip 32 bit header */
+ indata += 4;
+
for (i = 0; i < nsamples; i++) {
for (j = 0; j < channels; j++) {
guint32 in = GST_READ_UINT32_LE (indata);
+ /* Remove first 4 and last 4 bits as they only
+ * contain status data. Shift the 24 bit samples
+ * to the correct width afterwards. */
if (width == 2) {
in = (in >> 12) & 0xffff;
GST_WRITE_UINT16_LE (outdata, in);
@@ -132,6 +138,8 @@ mxf_d10_sound_handle_essence_element (const MXFUL * key, GstBuffer * buffer,
indata += 4;
outdata += width;
}
+ /* There are always 8 channels but only the first
+ * ones contain valid data, skip the others */
indata += 4 * (8 - channels);
}