diff options
| author | Edward Hervey <bilboed@bilboed.com> | 2009-08-09 09:43:00 +0200 | 
|---|---|---|
| committer | Edward Hervey <bilboed@bilboed.com> | 2009-08-10 09:58:33 +0200 | 
| commit | 0d6f0801f5c9052f40091cabe30b64cc487fe7de (patch) | |
| tree | 9623bc4c19f5315e847babefac9e545adde5fa0a | |
| parent | 153ae910a01e52e1c60e77a9fe821b195ea1d092 (diff) | |
rtp: Remove dead assignments and resulting unneeded variables.
| -rw-r--r-- | gst/rtp/gstrtpac3depay.c | 11 | ||||
| -rw-r--r-- | gst/rtp/gstrtpceltdepay.c | 1 | ||||
| -rw-r--r-- | gst/rtp/gstrtpj2kdepay.c | 11 | ||||
| -rw-r--r-- | gst/rtp/gstrtpj2kpay.c | 78 | 
4 files changed, 4 insertions, 97 deletions
| diff --git a/gst/rtp/gstrtpac3depay.c b/gst/rtp/gstrtpac3depay.c index 6165d901..90aa8328 100644 --- a/gst/rtp/gstrtpac3depay.c +++ b/gst/rtp/gstrtpac3depay.c @@ -175,16 +175,14 @@ gst_rtp_ac3_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)    rtpac3depay = GST_RTP_AC3_DEPAY (depayload);    { -    gint payload_len;      guint8 *payload;      guint16 FT, NF; -    payload_len = gst_rtp_buffer_get_payload_len (buf); -    payload = gst_rtp_buffer_get_payload (buf); - -    if (payload_len <= 2) +    if (gst_rtp_buffer_get_payload_len (buf) < 2)        goto empty_packet; +    payload = gst_rtp_buffer_get_payload (buf); +      /* strip off header       *       *  0                   1 @@ -198,9 +196,6 @@ gst_rtp_ac3_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)      GST_DEBUG_OBJECT (rtpac3depay, "FT: %d, NF: %d", FT, NF); -    payload_len -= 2; -    payload += 2; -      /* We don't bother with fragmented packets yet */      outbuf = gst_rtp_buffer_get_payload_subbuffer (buf, 2, -1); diff --git a/gst/rtp/gstrtpceltdepay.c b/gst/rtp/gstrtpceltdepay.c index db3a96d0..2263aad5 100644 --- a/gst/rtp/gstrtpceltdepay.c +++ b/gst/rtp/gstrtpceltdepay.c @@ -208,7 +208,6 @@ gst_rtp_celt_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)    total_size = 0;    offset = 0;    while (total_size < payload_len) { -    size = 0;      do {        s = payload[offset++];        total_size += s + 1; diff --git a/gst/rtp/gstrtpj2kdepay.c b/gst/rtp/gstrtpj2kdepay.c index 0d467e41..59904a53 100644 --- a/gst/rtp/gstrtpj2kdepay.c +++ b/gst/rtp/gstrtpj2kdepay.c @@ -125,14 +125,11 @@ gst_rtp_j2k_depay_finalize (GObject * object)  static gboolean  gst_rtp_j2k_depay_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps)  { -  GstRtpJ2KDepay *rtpj2kdepay;    GstStructure *structure;    gint clock_rate;    GstCaps *outcaps;    gboolean res; -  rtpj2kdepay = GST_RTP_J2K_DEPAY (depayload); -    structure = gst_caps_get_structure (caps, 0);    if (!gst_structure_get_int (structure, "clock-rate", &clock_rate)) @@ -154,7 +151,6 @@ gst_rtp_j2k_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)  {    GstRtpJ2KDepay *rtpj2kdepay;    GstBuffer *outbuf; -  gint payload_len;    guint8 *payload;    guint frag_offset; @@ -167,9 +163,7 @@ gst_rtp_j2k_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)      rtpj2kdepay->need_header = TRUE;    } -  payload_len = gst_rtp_buffer_get_payload_len (buf); - -  if (payload_len < 8) +  if (gst_rtp_buffer_get_payload_len (buf) < 8)      goto empty_packet;    payload = gst_rtp_buffer_get_payload (buf); @@ -194,9 +188,6 @@ gst_rtp_j2k_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)      rtpj2kdepay->need_header = FALSE;    } -  payload += 8; -  payload_len -= 8; -    /* take JPEG 2000 data, push in the adapter */    outbuf = gst_rtp_buffer_get_payload_subbuffer (buf, 8, -1);    gst_adapter_push (rtpj2kdepay->adapter, outbuf); diff --git a/gst/rtp/gstrtpj2kpay.c b/gst/rtp/gstrtpj2kpay.c index 1c40e438..a796e473 100644 --- a/gst/rtp/gstrtpj2kpay.c +++ b/gst/rtp/gstrtpj2kpay.c @@ -128,14 +128,6 @@ typedef struct    guint offset:24;  } RtpJ2KHeader; -static void gst_rtp_j2k_pay_set_property (GObject * object, guint prop_id, -    const GValue * value, GParamSpec * pspec); -static void gst_rtp_j2k_pay_get_property (GObject * object, guint prop_id, -    GValue * value, GParamSpec * pspec); - -static GstStateChangeReturn -gst_rtp_j2k_pay_change_state (GstElement * element, GstStateChange transition); -  static gboolean gst_rtp_j2k_pay_setcaps (GstBaseRTPPayload * basepayload,      GstCaps * caps); @@ -161,19 +153,10 @@ gst_rtp_j2k_pay_base_init (gpointer klass)  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; -  gobject_class->get_property = gst_rtp_j2k_pay_get_property; - -  gstelement_class->change_state = gst_rtp_j2k_pay_change_state; -    gstbasertppayload_class->set_caps = gst_rtp_j2k_pay_setcaps;    gstbasertppayload_class->handle_buffer = gst_rtp_j2k_pay_handle_buffer; @@ -401,67 +384,6 @@ done:    return ret;  } -static void -gst_rtp_j2k_pay_set_property (GObject * object, guint prop_id, -    const GValue * value, GParamSpec * pspec) -{ -  GstRtpJ2KPay *rtpj2kpay; - -  rtpj2kpay = GST_RTP_J2K_PAY (object); - -  switch (prop_id) { -    default: -      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -      break; -  } -} - -static void -gst_rtp_j2k_pay_get_property (GObject * object, guint prop_id, -    GValue * value, GParamSpec * pspec) -{ -  GstRtpJ2KPay *rtpj2kpay; - -  rtpj2kpay = GST_RTP_J2K_PAY (object); - -  switch (prop_id) { -    default: -      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -      break; -  } -} - -static GstStateChangeReturn -gst_rtp_j2k_pay_change_state (GstElement * element, GstStateChange transition) -{ -  GstRtpJ2KPay *rtpj2kpay; -  GstStateChangeReturn ret; - -  rtpj2kpay = GST_RTP_J2K_PAY (element); - -  switch (transition) { -    case GST_STATE_CHANGE_NULL_TO_READY: -      break; -    case GST_STATE_CHANGE_READY_TO_PAUSED: -      break; -    default: -      break; -  } - -  ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); - -  switch (transition) { -    case GST_STATE_CHANGE_PAUSED_TO_READY: -      break; -    case GST_STATE_CHANGE_READY_TO_NULL: -      break; -    default: -      break; -  } -  return ret; -} - -  gboolean  gst_rtp_j2k_pay_plugin_init (GstPlugin * plugin)  { | 
