rtp: fix rtptwcc to support big endian.
authorDoug Nazar <nazard@nazar.ca>
Tue, 13 Apr 2021 03:13:15 +0000 (23:13 -0400)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 13 Apr 2021 11:35:15 +0000 (11:35 +0000)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/942>

gst/rtpmanager/rtptwcc.c

index f5b5351..2a8782d 100644 (file)
@@ -696,14 +696,14 @@ static guint
 _parse_run_length_chunk (GstBitReader * reader, GArray * twcc_packets,
     guint16 seqnum_offset, guint remaining_packets)
 {
-  guint run_length;
+  guint16 run_length;
   guint8 status_code;
   guint i;
 
   gst_bit_reader_get_bits_uint8 (reader, &status_code, 2);
+  gst_bit_reader_get_bits_uint16 (reader, &run_length, 13);
 
-  run_length = *(guint16 *) reader->data & ~0xE0;       /* mask out the 3 last bits */
-  run_length = MIN (remaining_packets, GST_READ_UINT16_BE (&run_length));
+  run_length = MIN (remaining_packets, run_length);
 
   for (i = 0; i < run_length; i++) {
     _add_twcc_packet (twcc_packets, seqnum_offset + i, status_code);