rtpulpfec: don't use non-portable notation for 64-bit int constants

Use GLib macro instead, even if it's a bit unwieldy.
This commit is contained in:
Tim-Philipp Müller 2018-03-17 13:04:47 +00:00
parent c21765e88e
commit 65ede0b565
3 changed files with 7 additions and 4 deletions

View file

@ -336,7 +336,7 @@ gst_rtp_ulpfec_dec_recover (GstRtpUlpFecDec * self, guint32 ssrc, gint media_pt,
/* Is it the only 1 in the mask? Checking if we lacking single packet in
* that case FEC packet can be used for recovery */
if (missing_packets_mask == (1ULL << trailing_zeros)) {
if (missing_packets_mask == (G_GUINT64_CONSTANT (1) << trailing_zeros)) {
GstBuffer *ret;
*dst_seq =

View file

@ -224,7 +224,7 @@ gst_rtp_ulpfec_enc_stream_ctx_protect (GstRtpUlpFecEncStreamCtx * ctx,
}
}
g_assert (tmp_mask == 0ULL);
g_assert (tmp_mask == 0);
ret =
rtp_ulpfec_bitstring_to_fec_rtp_buffer (ctx->scratch_buf, seq_base,
fec_mask_long, fec_mask, FALSE, pt, seq, timestamp, ssrc);

View file

@ -161,14 +161,17 @@ rtp_ulpfec_get_headers_len (gboolean fec_mask_long)
return sizeof (RtpUlpFecHeader) + fec_level_hdr_get_size (fec_mask_long);
}
#define ONE_64BIT G_GUINT64_CONSTANT(1)
guint64
rtp_ulpfec_packet_mask_from_seqnum (guint16 seq,
guint16 fec_seq_base, gboolean fec_mask_long)
{
gint seq_delta = gst_rtp_buffer_compare_seqnum (fec_seq_base, seq);
if (seq_delta >= 0
&& seq_delta <= RTP_ULPFEC_SEQ_BASE_OFFSET_MAX (fec_mask_long))
return 1ULL << (RTP_ULPFEC_SEQ_BASE_OFFSET_MAX (TRUE) - seq_delta);
&& seq_delta <= RTP_ULPFEC_SEQ_BASE_OFFSET_MAX (fec_mask_long)) {
return ONE_64BIT << (RTP_ULPFEC_SEQ_BASE_OFFSET_MAX (TRUE) - seq_delta);
}
return 0;
}