From 65ede0b5651afbdf2ba8358a045daae864a3b24c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 17 Mar 2018 13:04:47 +0000 Subject: [PATCH] rtpulpfec: don't use non-portable notation for 64-bit int constants Use GLib macro instead, even if it's a bit unwieldy. --- gst/rtp/gstrtpulpfecdec.c | 2 +- gst/rtp/gstrtpulpfecenc.c | 2 +- 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 9c362bd..7b13451 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 c9e6850..c06b423 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 44d2a6e..326b5ff 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; } -- 2.7.4