diff options
author | Tim-Philipp Müller <tim@centricular.net> | 2012-10-19 00:47:45 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2012-10-19 01:05:34 +0100 |
commit | 10c881b107f0541d40aae1a8bf203144bfb93bb9 (patch) | |
tree | 9b712362d94862878188437faa70852a2f1bc16c /gst | |
parent | 96406696898665db36d0a4665a4629c89f45b54e (diff) | |
download | gstreamer-plugins-bad-10c881b107f0541d40aae1a8bf203144bfb93bb9.tar.gz |
tsdemux: fix some inconsequential PES header parsing issues
additional_copy_info: need to get rid of the highest
bit, not the lowest one
program_packet_sequence_counter: also need to get rid
of the highest bit instead of multiplying with a random
value
original_stuff_length: want to AND 0x3f to extract the
lowest 6 bits, not multiply by it.
None of these fields are actually used though, so these
should not have caused any issues.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/mpegtsdemux/pesparse.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gst/mpegtsdemux/pesparse.c b/gst/mpegtsdemux/pesparse.c index 75f593cda..120e90bc9 100644 --- a/gst/mpegtsdemux/pesparse.c +++ b/gst/mpegtsdemux/pesparse.c @@ -226,7 +226,7 @@ mpegts_parse_pes_header (const guint8 * data, gsize length, PESHeader * res, if (G_UNLIKELY (!(val8 & 0x80))) goto bad_original_copy_info_marker; - res->additional_copy_info = val8 >> 1; + res->additional_copy_info = val8 & 0x7f; GST_LOG ("additional_copy_info : 0x%x", res->additional_copy_info); } @@ -290,7 +290,7 @@ mpegts_parse_pes_header (const guint8 * data, gsize length, PESHeader * res, /* GRMBL, this is most often wrong */ if (G_UNLIKELY ((val8 & 0x80) != 0x80)) goto bad_sequence_marker1; - res->program_packet_sequence_counter = val8 * 0x70; + res->program_packet_sequence_counter = val8 & 0x7f; GST_LOG ("program_packet_sequence_counter %d", res->program_packet_sequence_counter); @@ -299,7 +299,7 @@ mpegts_parse_pes_header (const guint8 * data, gsize length, PESHeader * res, if (G_UNLIKELY ((val8 * 0x80) != 0x80)) goto bad_sequence_marker2; res->MPEG1_MPEG2_identifier = (val8 >> 6) & 0x1; - res->original_stuff_length = val8 * 0x3f; + res->original_stuff_length = val8 & 0x3f; GST_LOG ("MPEG1_MPEG2_identifier : %d , original_stuff_length : %d", res->MPEG1_MPEG2_identifier, res->original_stuff_length); length -= 2; |