Merge branch 'master' of code.vuplus.com:/opt/repository/openvuplus_3.0
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-multimedia / gstreamer / gstreamer1.0-plugin-dvbmediasink / audiosink_mpeg4_aac_header.patch
diff --git a/meta-openvuplus/recipes-multimedia/gstreamer/gstreamer1.0-plugin-dvbmediasink/audiosink_mpeg4_aac_header.patch b/meta-openvuplus/recipes-multimedia/gstreamer/gstreamer1.0-plugin-dvbmediasink/audiosink_mpeg4_aac_header.patch
new file mode 100644 (file)
index 0000000..f200d59
--- /dev/null
@@ -0,0 +1,34 @@
+commit 73a48e31bdd977d8aa51f06388d6122dec5b8d2c
+Author: hschang <chang@dev3>
+Date:   Thu Dec 10 14:29:53 2015 +0900
+
+    [gstdvbaudiosink] fix creation of ADTS header for AAC audio.
+    
+    fix according to:
+    https://github.com/christophecvr/gstreamer1.0-plugin-multibox-dvbmediasink/commit/0534a00ffd1341c29938547f9a1ed4d00d1c4e05
+    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=72c5c70b90c79efcf013e0e414809931815be797
+
+diff --git a/gstdvbaudiosink.c b/gstdvbaudiosink.c
+index f003020..20439cf 100644
+--- a/gstdvbaudiosink.c
++++ b/gstdvbaudiosink.c
+@@ -479,8 +479,8 @@ static gboolean gst_dvbaudiosink_set_caps(GstBaseSink *basesink, GstCaps *caps)
+                                               guint8 h[2];
+                                               gst_buffer_extract(gst_value_get_buffer(codec_data), 0, h, sizeof(h));
+ #endif
+-                                              guint8 obj_type =((h[0] & 0xC) >> 2) + 1;
+-                                              guint8 rate_idx =((h[0] & 0x3) << 1) |((h[1] & 0x80) >> 7);
++                                              guint8 obj_type =h[0] >> 3;
++                                              guint8 rate_idx =((h[0] & 0x7) << 1) |((h[1] & 0x80) >> 7);
+                                               guint8 channels =(h[1] & 0x78) >> 3;
+                                               GST_INFO_OBJECT(self, "have codec data -> obj_type = %d, rate_idx = %d, channels = %d\n",
+                                                       obj_type, rate_idx, channels);
+@@ -492,7 +492,7 @@ static gboolean gst_dvbaudiosink_set_caps(GstBaseSink *basesink, GstCaps *caps)
+                                               if (mpegversion == 2)
+                                                       self->aac_adts_header[1] |= 8;
+                                               /* Object type over first 2 bits */
+-                                              self->aac_adts_header[2] = obj_type << 6;
++                                              self->aac_adts_header[2] = (obj_type - 1) << 6;
+                                               /* rate index over next 4 bits */
+                                               self->aac_adts_header[2] |= rate_idx << 2;
+                                               /* channels over last 2 bits */