mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
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.
This commit is contained in:
parent
9640669689
commit
10c881b107
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue