h->slice_num = read_u8(buf + 18);
h->slice_bytes = read_u16(buf + 20);
- if (!h->group_bytes && & h->slice_bytes)
+ if (!memcmp(buf, FEC_EOF_PACKET, FEC_EOF_PACKET_LEN))
return -E_FECDEC_EOF;
// PARA_DEBUG_LOG("group %u, slize %u, slices per group: %u\n",
// h->group_num, h->slice_num, h->slices_per_group);
* horribly for characters which have their most significant bit set.
*/
#define para_isspace(c) isspace((int)(unsigned char)(c))
+
+/** Data that indicates an eof-condition for a fec-encoded stream. */
+#define FEC_EOF_PACKET "\xec\x0d\xcc\xfe\0\0\0\0" \
+ "\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0"
+#define FEC_EOF_PACKET_LEN 32
if (!ret)
return;
packet_size = ret;
+ if (packet_size >= FEC_EOF_PACKET_LEN)
+ if (!memcmp(tmpbuf, FEC_EOF_PACKET, FEC_EOF_PACKET_LEN))
+ return;
t->error = add_rn_output(rn, tmpbuf, packet_size);
if (t->error < 0)
return;
*/
size_t vss_get_fec_eof_packet(const char **buf)
{
- static const char fec_eof_packet[FEC_HEADER_SIZE] =
- "\xec\x0d\xcc\xfe\0\0\0\0"
- "\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0";
+ static const char fec_eof_packet[FEC_HEADER_SIZE] = FEC_EOF_PACKET;
*buf = fec_eof_packet;
return FEC_HEADER_SIZE;
}