Commit 10c881b1 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

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.
parent 96406696
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment