diff options
author | Edward Hervey <edward@centricular.com> | 2017-02-28 09:26:25 +0100 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2017-02-28 09:27:41 +0100 |
commit | fcf87ef2bf1967512e9e44f46f6a20eb542b6cc4 (patch) | |
tree | bd5c536710984be0402b0e5de07dace618f3d160 /gst | |
parent | 266324b97a04b54769d8330c07c76f553c0378a3 (diff) | |
download | gstreamer-plugins-bad-fcf87ef2bf1967512e9e44f46f6a20eb542b6cc4.tar.gz |
mpegtsdemux: Fix wrong usage of '<<' operator
Detected by GCC 7.
Add comments for clarity
https://bugzilla.gnome.org/show_bug.cgi?id=779333
Diffstat (limited to 'gst')
-rw-r--r-- | gst/mpegtsdemux/pesparse.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gst/mpegtsdemux/pesparse.c b/gst/mpegtsdemux/pesparse.c index 1d7a3b607..e0f11f2a0 100644 --- a/gst/mpegtsdemux/pesparse.c +++ b/gst/mpegtsdemux/pesparse.c @@ -314,14 +314,23 @@ mpegts_parse_pes_header (const guint8 * data, gsize length, PESHeader * res) } if (flags & 0x10) { - /* P-STD */ + /* P-STD + * '01' : 2 bits + * P-STD_buffer_scale : 1 bit + * P-STD_buffer_size : 13 bits + * */ if (G_UNLIKELY (length < 2)) goto need_more_data; val8 = *data; if (G_UNLIKELY ((val8 & 0xc0) != 0x40)) goto bad_P_STD_marker; + /* If P-STD_buffer_scale is 0 + * multiply by 128 (i.e. << 7), + * else + * multiply by 1024 (i.e. << 10) + */ res->P_STD_buffer_size = - (GST_READ_UINT16_BE (data) & 0x1fff) << (val8 & 0x20) ? 10 : 7; + (GST_READ_UINT16_BE (data) & 0x1fff) << ((val8 & 0x20) ? 10 : 7); GST_LOG ("P_STD_buffer_size : %d", res->P_STD_buffer_size); data += 2; length -= 2; |