summaryrefslogtreecommitdiff
path: root/gst/mpegtsmux
diff options
context:
space:
mode:
authorBob Holcomb <bholcomb@mak.com>2016-01-05 14:35:11 -0500
committerTim-Philipp Müller <tim@centricular.com>2016-01-09 16:38:04 +0000
commitcb520dce269b22eb105f19eac6f7abb4c13c86de (patch)
treead4593e9a27819e6109133334ed61dbf7fd2c6b9 /gst/mpegtsmux
parent8c7ea6fb87368054a56bd3dd3431c24e52910239 (diff)
downloadgstreamer-plugins-bad-cb520dce269b22eb105f19eac6f7abb4c13c86de.tar.gz
mpegtsmux: fix reserve bits so they are 1's
The MPEG standard (ISO-13880-1) says the reserve bits need to be set to one (2.1.64). This is causing transport streams to fail validation on some systems. https://bugzilla.gnome.org/show_bug.cgi?id=760127
Diffstat (limited to 'gst/mpegtsmux')
-rw-r--r--gst/mpegtsmux/tsmux/tsmux.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gst/mpegtsmux/tsmux/tsmux.c b/gst/mpegtsmux/tsmux/tsmux.c
index 00e1203e9..638de15aa 100644
--- a/gst/mpegtsmux/tsmux/tsmux.c
+++ b/gst/mpegtsmux/tsmux/tsmux.c
@@ -692,7 +692,7 @@ tsmux_write_adaptation_field (guint8 * buf,
buf[pos++] = (pcr_base >> 17) & 0xff;
buf[pos++] = (pcr_base >> 9) & 0xff;
buf[pos++] = (pcr_base >> 1) & 0xff;
- buf[pos++] = ((pcr_base << 7) & 0x80) | ((pcr_ext >> 8) & 0x01);
+ buf[pos++] = ((pcr_base << 7) & 0x80) | 0x7e | ((pcr_ext >> 8) & 0x01); /* set 6 reserve bits to 1 */
buf[pos++] = (pcr_ext) & 0xff;
}
if (pi->flags & TSMUX_PACKET_FLAG_WRITE_OPCR) {
@@ -708,7 +708,7 @@ tsmux_write_adaptation_field (guint8 * buf,
buf[pos++] = (opcr_base >> 17) & 0xff;
buf[pos++] = (opcr_base >> 9) & 0xff;
buf[pos++] = (opcr_base >> 1) & 0xff;
- buf[pos++] = ((opcr_base << 7) & 0x80) | ((opcr_ext >> 8) & 0x01);
+ buf[pos++] = ((opcr_base << 7) & 0x80) | 0x7e | ((opcr_ext >> 8) & 0x01); /* set 6 reserve bits to 1 */
buf[pos++] = (opcr_ext) & 0xff;
}
if (pi->flags & TSMUX_PACKET_FLAG_WRITE_SPLICE) {
@@ -730,7 +730,7 @@ tsmux_write_adaptation_field (guint8 * buf,
TS_DEBUG ("FIXME: write Adaptation extension");
/* Write an empty extension for now */
buf[pos++] = 1;
- buf[pos++] = 0;
+ buf[pos++] = 0x1f; /* lower 5 bits are reserved, and should be all 1 */
}
}
/* Write the flags at the start */