From 5b18c652fbb683e0b15a8f7a662e0acb1c32bac4 Mon Sep 17 00:00:00 2001 From: Robert Swain Date: Fri, 15 Apr 2011 14:57:20 +0200 Subject: [PATCH] rtp, rtpmanager: Address unused but set variables GCC 4.6.x spits warnings about variables that are unused but set. Such variables have been removed where trivial but with comments left behind for informational purposes in some cases. gst_rtp_session_chain_recv_rtcp () was changed in commit 490113d4 to always return GST_FLOW_OK instead of the return value of rtp_session_process_rtcp (), so we'll keep it that way. --- gst/rtp/gstrtpamrdepay.c | 3 +-- gst/rtp/gstrtpbvdepay.c | 2 -- gst/rtp/gstrtpbvpay.c | 2 -- gst/rtp/gstrtpg722pay.c | 4 ---- gst/rtp/gstrtpgstdepay.c | 6 +++--- gst/rtp/gstrtpgstpay.c | 16 ---------------- gst/rtp/gstrtpj2kpay.c | 2 -- gst/rtp/gstrtpmp4gpay.c | 4 ---- gst/rtp/gstrtpmp4vpay.c | 4 ---- gst/rtp/gstrtpmpadepay.c | 5 +---- gst/rtp/gstrtpqcelpdepay.c | 9 +++------ gst/rtpmanager/gstrtpjitterbuffer.c | 2 -- gst/rtpmanager/gstrtpsession.c | 6 ++---- 13 files changed, 10 insertions(+), 55 deletions(-) diff --git a/gst/rtp/gstrtpamrdepay.c b/gst/rtp/gstrtpamrdepay.c index f28904bddb..5a545bf8e7 100644 --- a/gst/rtp/gstrtpamrdepay.c +++ b/gst/rtp/gstrtpamrdepay.c @@ -290,7 +290,6 @@ gst_rtp_amr_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) * no robust sorting, no interleaving data is to be depayloaded */ { guint8 *payload, *p, *dp; - guint8 CMR; gint i, num_packets, num_nonempty_packets; gint amr_len; gint ILL, ILP; @@ -311,7 +310,7 @@ gst_rtp_amr_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) * | CMR |R|R|R|R| * +-+-+-+-+-+-+-+-+ */ - CMR = (payload[0] & 0xf0) >> 4; + /* CMR = (payload[0] & 0xf0) >> 4; */ /* strip CMR header now, pack FT and the data for the decoder */ payload_len -= 1; diff --git a/gst/rtp/gstrtpbvdepay.c b/gst/rtp/gstrtpbvdepay.c index 00c145267f..3ee660ae46 100644 --- a/gst/rtp/gstrtpbvdepay.c +++ b/gst/rtp/gstrtpbvdepay.c @@ -75,10 +75,8 @@ gst_rtp_bv_depay_base_init (gpointer klass) static void gst_rtp_bv_depay_class_init (GstRTPBVDepayClass * klass) { - GObjectClass *gobject_class; GstBaseRTPDepayloadClass *gstbasertpdepayload_class; - gobject_class = (GObjectClass *) klass; gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass; gstbasertpdepayload_class->process = gst_rtp_bv_depay_process; diff --git a/gst/rtp/gstrtpbvpay.c b/gst/rtp/gstrtpbvpay.c index 7ddc5781c9..0c01001055 100644 --- a/gst/rtp/gstrtpbvpay.c +++ b/gst/rtp/gstrtpbvpay.c @@ -93,10 +93,8 @@ gst_rtp_bv_pay_class_init (GstRTPBVPayClass * klass) static void gst_rtp_bv_pay_init (GstRTPBVPay * rtpbvpay, GstRTPBVPayClass * klass) { - GstBaseRTPPayload *basertppayload; GstBaseRTPAudioPayload *basertpaudiopayload; - basertppayload = GST_BASE_RTP_PAYLOAD (rtpbvpay); basertpaudiopayload = GST_BASE_RTP_AUDIO_PAYLOAD (rtpbvpay); rtpbvpay->mode = -1; diff --git a/gst/rtp/gstrtpg722pay.c b/gst/rtp/gstrtpg722pay.c index 7346ca149a..29cd22a647 100644 --- a/gst/rtp/gstrtpg722pay.c +++ b/gst/rtp/gstrtpg722pay.c @@ -190,10 +190,6 @@ gst_rtp_g722_pay_getcaps (GstBaseRTPPayload * rtppayload, GstPad * pad) if (otherpadcaps) { if (!gst_caps_is_empty (otherpadcaps)) { - GstStructure *structure; - - structure = gst_caps_get_structure (otherpadcaps, 0); - gst_caps_set_simple (caps, "channels", G_TYPE_INT, 1, NULL); gst_caps_set_simple (caps, "rate", G_TYPE_INT, 16000, NULL); } diff --git a/gst/rtp/gstrtpgstdepay.c b/gst/rtp/gstrtpgstdepay.c index 4e536bafac..6dc5e511aa 100644 --- a/gst/rtp/gstrtpgstdepay.c +++ b/gst/rtp/gstrtpgstdepay.c @@ -183,7 +183,6 @@ gst_rtp_gst_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) GstBuffer *subbuf, *outbuf = NULL; gint payload_len; guint8 *payload; - guint16 frag_offset; guint CV; rtpgstdepay = GST_RTP_GST_DEPAY (depayload); @@ -210,8 +209,9 @@ gst_rtp_gst_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) * | Frag_offset | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ - frag_offset = - (payload[4] << 24) | (payload[5] << 16) | (payload[6] << 8) | payload[7]; + /* frag_offset = + * (payload[4] << 24) | (payload[5] << 16) | (payload[6] << 8) | payload[7]; + */ /* subbuffer skipping the 8 header bytes */ subbuf = gst_rtp_buffer_get_payload_subbuffer (buf, 8, -1); diff --git a/gst/rtp/gstrtpgstpay.c b/gst/rtp/gstrtpgstpay.c index 67dd1bf8c2..dfdd95404e 100644 --- a/gst/rtp/gstrtpgstpay.c +++ b/gst/rtp/gstrtpgstpay.c @@ -68,8 +68,6 @@ GST_STATIC_PAD_TEMPLATE ("src", "clock-rate = (int) 90000, " "encoding-name = (string) \"X-GST\"") ); -static void gst_rtp_gst_pay_finalize (GObject * object); - static gboolean gst_rtp_gst_pay_setcaps (GstBaseRTPPayload * payload, GstCaps * caps); static GstFlowReturn gst_rtp_gst_pay_handle_buffer (GstBaseRTPPayload * payload, @@ -96,14 +94,10 @@ GST_BOILERPLATE (GstRtpGSTPay, gst_rtp_gst_pay, GstBaseRTPPayload, static void gst_rtp_gst_pay_class_init (GstRtpGSTPayClass * klass) { - GObjectClass *gobject_class; GstBaseRTPPayloadClass *gstbasertppayload_class; - gobject_class = (GObjectClass *) klass; gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass; - gobject_class->finalize = gst_rtp_gst_pay_finalize; - gstbasertppayload_class->set_caps = gst_rtp_gst_pay_setcaps; gstbasertppayload_class->handle_buffer = gst_rtp_gst_pay_handle_buffer; } @@ -113,16 +107,6 @@ gst_rtp_gst_pay_init (GstRtpGSTPay * rtpgstpay, GstRtpGSTPayClass * klass) { } -static void -gst_rtp_gst_pay_finalize (GObject * object) -{ - GstRtpGSTPay *rtpgstpay; - - rtpgstpay = GST_RTP_GST_PAY (object); - - G_OBJECT_CLASS (parent_class)->finalize (object); -} - static gboolean gst_rtp_gst_pay_setcaps (GstBaseRTPPayload * payload, GstCaps * caps) { diff --git a/gst/rtp/gstrtpj2kpay.c b/gst/rtp/gstrtpj2kpay.c index 3734534f8b..782cf229f3 100644 --- a/gst/rtp/gstrtpj2kpay.c +++ b/gst/rtp/gstrtpj2kpay.c @@ -134,11 +134,9 @@ static void gst_rtp_j2k_pay_class_init (GstRtpJ2KPayClass * klass) { GObjectClass *gobject_class; - GstElementClass *gstelement_class; GstBaseRTPPayloadClass *gstbasertppayload_class; gobject_class = (GObjectClass *) klass; - gstelement_class = (GstElementClass *) klass; gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass; gobject_class->set_property = gst_rtp_j2k_pay_set_property; diff --git a/gst/rtp/gstrtpmp4gpay.c b/gst/rtp/gstrtpmp4gpay.c index c095064062..b3a69662cc 100644 --- a/gst/rtp/gstrtpmp4gpay.c +++ b/gst/rtp/gstrtpmp4gpay.c @@ -451,11 +451,8 @@ gst_rtp_mp4g_pay_flush (GstRtpMP4GPay * rtpmp4gpay) guint avail, total; GstBuffer *outbuf; GstFlowReturn ret; - gboolean fragmented; guint mtu; - fragmented = FALSE; - /* the data available in the adapter is either smaller * than the MTU or bigger. In the case it is smaller, the complete * adapter contents can be put in one packet. In the case the @@ -544,7 +541,6 @@ gst_rtp_mp4g_pay_flush (GstRtpMP4GPay * rtpmp4gpay) ret = gst_basertppayload_push (GST_BASE_RTP_PAYLOAD (rtpmp4gpay), outbuf); avail -= payload_len; - fragmented = TRUE; } return ret; diff --git a/gst/rtp/gstrtpmp4vpay.c b/gst/rtp/gstrtpmp4vpay.c index 811e1b4a58..568bd835c5 100644 --- a/gst/rtp/gstrtpmp4vpay.c +++ b/gst/rtp/gstrtpmp4vpay.c @@ -141,8 +141,6 @@ gst_rtp_mp4v_pay_class_init (GstRtpMP4VPayClass * klass) static void gst_rtp_mp4v_pay_init (GstRtpMP4VPay * rtpmp4vpay, GstRtpMP4VPayClass * klass) { - GstPad *sinkpad; - rtpmp4vpay->adapter = gst_adapter_new (); rtpmp4vpay->rate = 90000; rtpmp4vpay->profile = 1; @@ -153,8 +151,6 @@ gst_rtp_mp4v_pay_init (GstRtpMP4VPay * rtpmp4vpay, GstRtpMP4VPayClass * klass) rtpmp4vpay->last_config = -1; rtpmp4vpay->config = NULL; - - sinkpad = GST_BASE_RTP_PAYLOAD_SINKPAD (rtpmp4vpay); } static void diff --git a/gst/rtp/gstrtpmpadepay.c b/gst/rtp/gstrtpmpadepay.c index a76a7f39e6..1fdc8d449a 100644 --- a/gst/rtp/gstrtpmpadepay.c +++ b/gst/rtp/gstrtpmpadepay.c @@ -127,8 +127,6 @@ gst_rtp_mpa_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) { gint payload_len; - guint8 *payload; - guint16 frag_offset; gboolean marker; payload_len = gst_rtp_buffer_get_payload_len (buf); @@ -136,7 +134,6 @@ gst_rtp_mpa_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) if (payload_len <= 4) goto empty_packet; - payload = gst_rtp_buffer_get_payload (buf); /* strip off header * * 0 1 2 3 @@ -145,7 +142,7 @@ gst_rtp_mpa_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) * | MBZ | Frag_offset | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ - frag_offset = (payload[2] << 8) | payload[3]; + /* frag_offset = (payload[2] << 8) | payload[3]; */ /* subbuffer skipping the 4 header bytes */ outbuf = gst_rtp_buffer_get_payload_subbuffer (buf, 4, -1); diff --git a/gst/rtp/gstrtpqcelpdepay.c b/gst/rtp/gstrtpqcelpdepay.c index badeb9f244..7949ae7804 100644 --- a/gst/rtp/gstrtpqcelpdepay.c +++ b/gst/rtp/gstrtpqcelpdepay.c @@ -118,7 +118,7 @@ static void gst_rtp_qcelp_depay_init (GstRtpQCELPDepay * rtpqcelpdepay, GstRtpQCELPDepayClass * klass) { - GstBaseRTPDepayload *depayload; + GstBaseRTPDepayload G_GNUC_UNUSED *depayload; depayload = GST_BASE_RTP_DEPAYLOAD (rtpqcelpdepay); } @@ -144,11 +144,8 @@ static gboolean gst_rtp_qcelp_depay_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps) { GstCaps *srccaps; - GstRtpQCELPDepay *rtpqcelpdepay; gboolean res; - rtpqcelpdepay = GST_RTP_QCELP_DEPAY (depayload); - srccaps = gst_caps_new_simple ("audio/qcelp", "channels", G_TYPE_INT, 1, "rate", G_TYPE_INT, 8000, NULL); res = gst_pad_set_caps (GST_BASE_RTP_DEPAYLOAD_SRCPAD (depayload), srccaps); @@ -263,7 +260,7 @@ gst_rtp_qcelp_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) GstClockTime timestamp; guint payload_len, offset, index; guint8 *payload; - guint RR, LLL, NNN; + guint LLL, NNN; depay = GST_RTP_QCELP_DEPAY (depayload); @@ -281,7 +278,7 @@ gst_rtp_qcelp_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) * |RR | LLL | NNN | * +-+-+-+-+-+-+-+-+ */ - RR = payload[0] >> 6; + /* RR = payload[0] >> 6; */ LLL = (payload[0] & 0x38) >> 3; NNN = (payload[0] & 0x07); diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c index 260aba51f1..e11869985e 100644 --- a/gst/rtpmanager/gstrtpjitterbuffer.c +++ b/gst/rtpmanager/gstrtpjitterbuffer.c @@ -1144,10 +1144,8 @@ static gboolean gst_rtp_jitter_buffer_sink_rtcp_event (GstPad * pad, GstEvent * event) { GstRtpJitterBuffer *jitterbuffer; - GstRtpJitterBufferPrivate *priv; jitterbuffer = GST_RTP_JITTER_BUFFER (gst_pad_get_parent (pad)); - priv = jitterbuffer->priv; GST_DEBUG_OBJECT (jitterbuffer, "received %s", GST_EVENT_TYPE_NAME (event)); diff --git a/gst/rtpmanager/gstrtpsession.c b/gst/rtpmanager/gstrtpsession.c index 3be6392ba3..986b81a4d2 100644 --- a/gst/rtpmanager/gstrtpsession.c +++ b/gst/rtpmanager/gstrtpsession.c @@ -1597,7 +1597,6 @@ gst_rtp_session_chain_recv_rtcp (GstPad * pad, GstBuffer * buffer) GstRtpSessionPrivate *priv; GstClockTime current_time; guint64 ntpnstime; - GstFlowReturn ret; rtpsession = GST_RTP_SESSION (gst_pad_get_parent (pad)); priv = rtpsession->priv; @@ -1607,12 +1606,11 @@ gst_rtp_session_chain_recv_rtcp (GstPad * pad, GstBuffer * buffer) current_time = gst_clock_get_time (priv->sysclock); get_current_times (rtpsession, NULL, &ntpnstime); - ret = - rtp_session_process_rtcp (priv->session, buffer, current_time, ntpnstime); + rtp_session_process_rtcp (priv->session, buffer, current_time, ntpnstime); gst_object_unref (rtpsession); - return GST_FLOW_OK; + return GST_FLOW_OK; /* always return OK */ } static gboolean