diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2018-03-17 13:04:47 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2018-03-17 13:04:47 +0000 |
commit | 65ede0b5651afbdf2ba8358a045daae864a3b24c (patch) | |
tree | 0911995f6840e8a42ac4085a3cdbeea1227a8a03 | |
parent | c21765e88eb38714b509927388e8d90032744f69 (diff) |
rtpulpfec: don't use non-portable notation for 64-bit int constants
Use GLib macro instead, even if it's a bit unwieldy.
-rw-r--r-- | gst/rtp/gstrtpulpfecdec.c | 2 | ||||
-rw-r--r-- | gst/rtp/gstrtpulpfecenc.c | 2 | ||||
-rw-r--r-- | gst/rtp/rtpulpfeccommon.c | 7 |
3 files changed, 7 insertions, 4 deletions
diff --git a/gst/rtp/gstrtpulpfecdec.c b/gst/rtp/gstrtpulpfecdec.c index 9c362bdcd..7b1345164 100644 --- a/gst/rtp/gstrtpulpfecdec.c +++ b/gst/rtp/gstrtpulpfecdec.c @@ -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 = diff --git a/gst/rtp/gstrtpulpfecenc.c b/gst/rtp/gstrtpulpfecenc.c index c9e68509a..c06b4232d 100644 --- a/gst/rtp/gstrtpulpfecenc.c +++ b/gst/rtp/gstrtpulpfecenc.c @@ -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); diff --git a/gst/rtp/rtpulpfeccommon.c b/gst/rtp/rtpulpfeccommon.c index 44d2a6e59..326b5ffd4 100644 --- a/gst/rtp/rtpulpfeccommon.c +++ b/gst/rtp/rtpulpfeccommon.c @@ -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; } |