summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2012-06-16 16:50:32 +0200
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2012-06-16 19:23:00 +0200
commitfd92a8b65a1bb79de899a9810e138eadc728ad52 (patch)
treebeb1f8fd38be2e78a67c0d9cfc1b2cf54eb503a3 /gst
parentc76627ec9a213b4761b7dc59a007662391787414 (diff)
downloadgstreamer-plugins-bad-fd92a8b65a1bb79de899a9810e138eadc728ad52.tar.gz
mpegtsmux: optionally set data_alignment flag in PES header
Diffstat (limited to 'gst')
-rw-r--r--gst/mpegtsmux/tsmux/tsmuxcommon.h1
-rw-r--r--gst/mpegtsmux/tsmux/tsmuxstream.c6
2 files changed, 6 insertions, 1 deletions
diff --git a/gst/mpegtsmux/tsmux/tsmuxcommon.h b/gst/mpegtsmux/tsmux/tsmuxcommon.h
index 5ff682661..c9f087e2e 100644
--- a/gst/mpegtsmux/tsmux/tsmuxcommon.h
+++ b/gst/mpegtsmux/tsmux/tsmuxcommon.h
@@ -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)
diff --git a/gst/mpegtsmux/tsmux/tsmuxstream.c b/gst/mpegtsmux/tsmux/tsmuxstream.c
index 75c2791b2..ecc0be8a8 100644
--- a/gst/mpegtsmux/tsmux/tsmuxstream.c
+++ b/gst/mpegtsmux/tsmux/tsmuxstream.c
@@ -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)