rtp: Remove dead assignments and resulting unneeded variables.

This commit is contained in:
Edward Hervey 2009-08-09 09:43:00 +02:00
parent 153ae910a0
commit 0d6f0801f5
4 changed files with 4 additions and 97 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -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)
{