mpegtsmux: optionally set data_alignment flag in PES header
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Sat, 16 Jun 2012 14:50:32 +0000 (16:50 +0200)
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Sat, 16 Jun 2012 17:23:00 +0000 (19:23 +0200)
gst/mpegtsmux/tsmux/tsmuxcommon.h
gst/mpegtsmux/tsmux/tsmuxstream.c

index 5ff6826..c9f087e 100644 (file)
@@ -113,6 +113,7 @@ G_BEGIN_DECLS
 #define TSMUX_PACKET_FLAG_PES_WRITE_PTS_DTS (1 << 10)
 #define TSMUX_PACKET_FLAG_PES_WRITE_ESCR    (1 << 11)
 #define TSMUX_PACKET_FLAG_PES_EXT_STREAMID  (1 << 12)
+#define TSMUX_PACKET_FLAG_PES_DATA_ALIGNMENT (1 << 13)
 
 /* PAT interval (1/10th sec) */
 #define TSMUX_DEFAULT_PAT_INTERVAL (TSMUX_CLOCK_FREQ / 10)
index 75c2791..ecc0be8 100644 (file)
@@ -578,7 +578,11 @@ tsmux_stream_write_pes_header (TsMuxStream * stream, guint8 * data)
     guint8 flags = 0;
 
     /* Not scrambled, original, not-copyrighted, data_alignment not specified */
-    *data++ = 0x81;
+    flags = 0x81;
+    if (stream->pi.flags & TSMUX_PACKET_FLAG_PES_DATA_ALIGNMENT)
+      flags |= 0x4;
+    *data++ = flags;
+    flags = 0;
 
     /* Flags */
     if (stream->pi.flags & TSMUX_PACKET_FLAG_PES_WRITE_PTS_DTS)