From: Edward Hervey Date: Sat, 8 Aug 2009 13:54:02 +0000 (+0200) Subject: gst: Remove dead assignments and resulting unused variables X-Git-Tag: 1.19.3~511^2~9350 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8cd1b5209b68944e1be56ca8bb69e46d4abb7a34;p=platform%2Fupstream%2Fgstreamer.git gst: Remove dead assignments and resulting unused variables --- diff --git a/gst/adder/gstadder.c b/gst/adder/gstadder.c index 7153407..3f067d0 100644 --- a/gst/adder/gstadder.c +++ b/gst/adder/gstadder.c @@ -636,7 +636,6 @@ forward_event (GstAdder * adder, GstEvent * event, gboolean flush) GST_LOG_OBJECT (adder, "Forwarding event %p (%s)", event, GST_EVENT_TYPE_NAME (event)); - ret = TRUE; data.event = event; data.flush = flush; diff --git a/gst/audioconvert/gstaudioconvert.c b/gst/audioconvert/gstaudioconvert.c index 593f26e..90108a3 100644 --- a/gst/audioconvert/gstaudioconvert.c +++ b/gst/audioconvert/gstaudioconvert.c @@ -1080,7 +1080,6 @@ gst_audio_convert_transform (GstBaseTransform * base, GstBuffer * inbuf, GstBuffer * outbuf) { GstAudioConvert *this = GST_AUDIO_CONVERT (base); - gboolean res; gint insize, outsize; gint samples; gpointer src, dst; @@ -1090,7 +1089,7 @@ gst_audio_convert_transform (GstBaseTransform * base, GstBuffer * inbuf, /* get in/output sizes, to see if the buffers we got are of correct * sizes */ - if (!(res = audio_convert_get_sizes (&this->ctx, samples, &insize, &outsize))) + if (!audio_convert_get_sizes (&this->ctx, samples, &insize, &outsize)) goto error; if (insize == 0 || outsize == 0) @@ -1108,8 +1107,8 @@ gst_audio_convert_transform (GstBaseTransform * base, GstBuffer * inbuf, /* and convert the samples */ if (!GST_BUFFER_FLAG_IS_SET (inbuf, GST_BUFFER_FLAG_GAP)) { - if (!(res = audio_convert_convert (&this->ctx, src, dst, - samples, gst_buffer_is_writable (inbuf)))) + if (!audio_convert_convert (&this->ctx, src, dst, + samples, gst_buffer_is_writable (inbuf))) goto convert_error; } else { /* Create silence buffer */ diff --git a/gst/audioresample/gstaudioresample.c b/gst/audioresample/gstaudioresample.c index 7b415f2..e7f5acc 100644 --- a/gst/audioresample/gstaudioresample.c +++ b/gst/audioresample/gstaudioresample.c @@ -521,7 +521,6 @@ gst_audio_resample_transform_size (GstBaseTransform * base, GstPadDirection direction, GstCaps * caps, guint size, GstCaps * othercaps, guint * othersize) { - GstCaps *srccaps, *sinkcaps; gboolean ret = TRUE; guint32 ratio_den, ratio_num; gint inrate, outrate, gcd; @@ -529,13 +528,6 @@ gst_audio_resample_transform_size (GstBaseTransform * base, GST_LOG_OBJECT (base, "asked to transform size %d in direction %s", size, direction == GST_PAD_SINK ? "SINK" : "SRC"); - if (direction == GST_PAD_SINK) { - sinkcaps = caps; - srccaps = othercaps; - } else { - sinkcaps = othercaps; - srccaps = caps; - } /* Get sample width -> bytes_per_samp, channels, inrate, outrate */ ret = @@ -1045,10 +1037,9 @@ gst_audio_resample_transform (GstBaseTransform * base, GstBuffer * inbuf, GstBuffer * outbuf) { GstAudioResample *resample = GST_AUDIO_RESAMPLE (base); - guint8 *data; gulong size; GstClockTime timestamp; - guint outsamples, insamples; + guint insamples; GstFlowReturn ret; if (resample->state == NULL) { @@ -1062,7 +1053,6 @@ gst_audio_resample_transform (GstBaseTransform * base, GstBuffer * inbuf, gst_audio_resample_get_funcs (resample->width, resample->fp); } - data = GST_BUFFER_DATA (inbuf); size = GST_BUFFER_SIZE (inbuf); timestamp = GST_BUFFER_TIMESTAMP (inbuf); @@ -1089,9 +1079,6 @@ gst_audio_resample_transform (GstBaseTransform * base, GstBuffer * inbuf, insamples = GST_BUFFER_SIZE (inbuf) / resample->channels; insamples /= (resample->width / 8); - outsamples = GST_BUFFER_SIZE (outbuf) / resample->channels; - outsamples /= (resample->width / 8); - if (GST_CLOCK_TIME_IS_VALID (timestamp) && !GST_CLOCK_TIME_IS_VALID (resample->next_ts)) { resample->next_ts = timestamp; diff --git a/gst/ffmpegcolorspace/gstffmpegcolorspace.c b/gst/ffmpegcolorspace/gstffmpegcolorspace.c index 2cd9737..6e2f5e4 100644 --- a/gst/ffmpegcolorspace/gstffmpegcolorspace.c +++ b/gst/ffmpegcolorspace/gstffmpegcolorspace.c @@ -338,11 +338,9 @@ static void gst_ffmpegcsp_class_init (GstFFMpegCspClass * klass) { GObjectClass *gobject_class; - GstElementClass *gstelement_class; GstBaseTransformClass *gstbasetransform_class; gobject_class = (GObjectClass *) klass; - gstelement_class = (GstElementClass *) klass; gstbasetransform_class = (GstBaseTransformClass *) klass; parent_class = g_type_class_peek_parent (klass); diff --git a/gst/ffmpegcolorspace/imgconvert.c b/gst/ffmpegcolorspace/imgconvert.c index edb538b..8863063 100644 --- a/gst/ffmpegcolorspace/imgconvert.c +++ b/gst/ffmpegcolorspace/imgconvert.c @@ -827,8 +827,6 @@ yuv422_to_yuv420p (AVPicture * dst, const AVPicture * src, lum[0] = p[0]; cb[0] = p[1]; cr[0] = p[3]; - cb++; - cr++; } p1 += src->linesize[0]; lum1 += dst->linesize[0]; @@ -910,8 +908,6 @@ uyvy422_to_yuv420p (AVPicture * dst, const AVPicture * src, lum[0] = p[1]; cb[0] = p[0]; cr[0] = p[2]; - cb++; - cr++; } p1 += src->linesize[0]; lum1 += dst->linesize[0]; @@ -1028,8 +1024,6 @@ yvyu422_to_yuv420p (AVPicture * dst, const AVPicture * src, lum[0] = p[0]; cb[0] = p[3]; cr[0] = p[1]; - cb++; - cr++; } p1 += src->linesize[0]; lum1 += dst->linesize[0]; @@ -3035,22 +3029,10 @@ img_convert (AVPicture * dst, int dst_pix_fmt, /* YUV to YUV planar */ if (is_yuv_planar (dst_pix) && is_yuv_planar (src_pix)) { - int x_shift, y_shift, w, h, xy_shift; + int x_shift, y_shift, xy_shift; void (*resize_func) (uint8_t * dst, int dst_wrap, const uint8_t * src, int src_wrap, int width, int height); - /* compute chroma size of the smallest dimensions */ - w = dst_width; - h = dst_height; - if (dst_pix->x_chroma_shift >= src_pix->x_chroma_shift) - w >>= dst_pix->x_chroma_shift; - else - w >>= src_pix->x_chroma_shift; - if (dst_pix->y_chroma_shift >= src_pix->y_chroma_shift) - h >>= dst_pix->y_chroma_shift; - else - h >>= src_pix->y_chroma_shift; - x_shift = (dst_pix->x_chroma_shift - src_pix->x_chroma_shift); y_shift = (dst_pix->y_chroma_shift - src_pix->y_chroma_shift); xy_shift = ((x_shift & 0xf) << 4) | (y_shift & 0xf); diff --git a/gst/playback/gstdecodebin.c b/gst/playback/gstdecodebin.c index 141f8c5..a59c084 100644 --- a/gst/playback/gstdecodebin.c +++ b/gst/playback/gstdecodebin.c @@ -226,11 +226,9 @@ gst_decode_bin_class_init (GstDecodeBinClass * klass) { GObjectClass *gobject_klass; GstElementClass *gstelement_klass; - GstBinClass *gstbin_klass; gobject_klass = (GObjectClass *) klass; gstelement_klass = (GstElementClass *) klass; - gstbin_klass = (GstBinClass *) klass; parent_class = g_type_class_peek_parent (klass); @@ -1159,8 +1157,6 @@ try_to_link_1 (GstDecodeBin * decode_bin, GstElement * srcelement, GstPad * pad, gst_element_set_state (element, GST_STATE_NULL); gst_bin_remove (GST_BIN (decode_bin), element); } else { - guint sig; - GST_DEBUG_OBJECT (decode_bin, "linked on pad %s:%s", GST_DEBUG_PAD_NAME (usedsrcpad)); @@ -1176,7 +1172,7 @@ try_to_link_1 (GstDecodeBin * decode_bin, GstElement * srcelement, GstPad * pad, /* The link worked, now figure out what it was that we connected */ /* make sure we catch unlink signals */ - sig = g_signal_connect (G_OBJECT (pad), "unlinked", + g_signal_connect (G_OBJECT (pad), "unlinked", G_CALLBACK (unlinked), decode_bin); /* now that we added the element we can try to continue autoplugging diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 0c36d8f..1ad7cf6 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -397,11 +397,9 @@ gst_decode_bin_class_init (GstDecodeBinClass * klass) { GObjectClass *gobject_klass; GstElementClass *gstelement_klass; - GstBinClass *gstbin_klass; gobject_klass = (GObjectClass *) klass; gstelement_klass = (GstElementClass *) klass; - gstbin_klass = (GstBinClass *) klass; parent_class = g_type_class_peek_parent (klass); @@ -1668,7 +1666,7 @@ is_demuxer_element (GstElement * srcelement) { GstElementFactory *srcfactory; GstElementClass *elemclass; - GList *templates, *walk; + GList *walk; const gchar *klass; gint potential_src_pads = 0; @@ -1683,7 +1681,7 @@ is_demuxer_element (GstElement * srcelement) * might produce */ elemclass = GST_ELEMENT_GET_CLASS (srcelement); - walk = templates = gst_element_class_get_pad_template_list (elemclass); + walk = gst_element_class_get_pad_template_list (elemclass); while (walk != NULL) { GstPadTemplate *templ; diff --git a/gst/playback/gstfactorylists.c b/gst/playback/gstfactorylists.c index 667beaf..7099927 100644 --- a/gst/playback/gstfactorylists.c +++ b/gst/playback/gstfactorylists.c @@ -159,8 +159,7 @@ gst_factory_list_get_elements (GstFactoryListType type) data.type = type; /* get the feature list using the filter */ - list = - gst_default_registry_feature_filter ((GstPluginFeatureFilter) + list = gst_default_registry_feature_filter ((GstPluginFeatureFilter) element_filter, FALSE, &data); /* convert to an array */ diff --git a/gst/playback/gstinputselector.c b/gst/playback/gstinputselector.c index ae0fa45..065196e 100644 --- a/gst/playback/gstinputselector.c +++ b/gst/playback/gstinputselector.c @@ -1182,14 +1182,11 @@ gst_input_selector_getcaps (GstPad * pad) } /* check if the pad is the active sinkpad */ -static gboolean +static inline gboolean gst_input_selector_is_active_sinkpad (GstInputSelector * sel, GstPad * pad) { - GstSelectorPad *selpad; gboolean res; - selpad = GST_SELECTOR_PAD_CAST (pad); - GST_INPUT_SELECTOR_LOCK (sel); res = (pad == sel->active_sinkpad); GST_INPUT_SELECTOR_UNLOCK (sel); diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index 48fb1d2..8c326d2 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -1216,7 +1216,7 @@ gen_subp_chain (GstPlaySink * playsink) gst_object_ref (bin); gst_object_sink (bin); - videosinkpad = subpsinkpad = srcpad = NULL; + subpsinkpad = srcpad = NULL; /* first try to hook the text pad to the custom sink */ if (playsink->subp_sink) { @@ -2346,7 +2346,7 @@ gst_play_sink_handle_message (GstBin * bin, GstMessage * message) GstFormat format; guint64 amount; gdouble rate; - gboolean flush, intermediate, res, eos; + gboolean flush, intermediate, eos; guint64 duration; GST_INFO_OBJECT (playsink, "Handling step-done message"); @@ -2362,9 +2362,7 @@ gst_play_sink_handle_message (GstBin * bin, GstMessage * message) gst_event_new_step (GST_FORMAT_TIME, duration, rate, flush, intermediate); - if (!(res = - gst_element_send_event (playsink->audiochain->chain.bin, - event))) { + if (!gst_element_send_event (playsink->audiochain->chain.bin, event)) { GST_DEBUG_OBJECT (playsink, "Event failed when sent to audio sink"); } } diff --git a/gst/playback/gststreamselector.c b/gst/playback/gststreamselector.c index 6ee0e51..7020e68 100644 --- a/gst/playback/gststreamselector.c +++ b/gst/playback/gststreamselector.c @@ -437,7 +437,6 @@ ignore: } static void gst_stream_selector_dispose (GObject * object); -static void gst_stream_selector_finalize (GObject * object); static void gst_stream_selector_init (GstStreamSelector * sel); static void gst_stream_selector_base_init (GstStreamSelectorClass * klass); @@ -505,7 +504,6 @@ gst_stream_selector_class_init (GstStreamSelectorClass * klass) parent_class = g_type_class_peek_parent (klass); gobject_class->dispose = gst_stream_selector_dispose; - gobject_class->finalize = gst_stream_selector_finalize; gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_stream_selector_set_property); @@ -554,16 +552,6 @@ gst_stream_selector_dispose (GObject * object) } static void -gst_stream_selector_finalize (GObject * object) -{ - GstStreamSelector *sel; - - sel = GST_STREAM_SELECTOR (object); - - G_OBJECT_CLASS (parent_class)->finalize (object); -} - -static void gst_stream_selector_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { @@ -676,14 +664,11 @@ gst_stream_selector_getcaps (GstPad * pad) } /* check if the pad is the active sinkpad */ -static gboolean +static inline gboolean gst_stream_selector_is_active_sinkpad (GstStreamSelector * sel, GstPad * pad) { - GstSelectorPad *selpad; gboolean res; - selpad = GST_SELECTOR_PAD_CAST (pad); - GST_OBJECT_LOCK (sel); res = (pad == sel->active_sinkpad); GST_OBJECT_UNLOCK (sel); diff --git a/gst/tcp/gsttcpclientsink.c b/gst/tcp/gsttcpclientsink.c index 6fe08b6..5339444 100644 --- a/gst/tcp/gsttcpclientsink.c +++ b/gst/tcp/gsttcpclientsink.c @@ -441,7 +441,7 @@ gst_tcp_client_sink_change_state (GstElement * element, switch (transition) { case GST_STATE_CHANGE_NULL_TO_READY: case GST_STATE_CHANGE_READY_TO_PAUSED: - if (!gst_tcp_client_sink_start (GST_TCP_CLIENT_SINK (element))) + if (!gst_tcp_client_sink_start (sink)) goto start_failure; break; default: @@ -451,7 +451,7 @@ gst_tcp_client_sink_change_state (GstElement * element, switch (transition) { case GST_STATE_CHANGE_READY_TO_NULL: - gst_tcp_client_sink_stop (GST_TCP_CLIENT_SINK (element)); + gst_tcp_client_sink_stop (sink); default: break; } diff --git a/gst/videoscale/gstvideoscale.c b/gst/videoscale/gstvideoscale.c index cceb6a3..f572377 100644 --- a/gst/videoscale/gstvideoscale.c +++ b/gst/videoscale/gstvideoscale.c @@ -358,20 +358,12 @@ gst_video_scale_transform_caps (GstBaseTransform * trans, GstVideoScale *videoscale; GstCaps *ret; GstStructure *structure; - const GValue *par; - gint method; /* this function is always called with a simple caps */ g_return_val_if_fail (GST_CAPS_IS_SIMPLE (caps), NULL); videoscale = GST_VIDEO_SCALE (trans); - GST_OBJECT_LOCK (videoscale); - method = videoscale->method; - GST_OBJECT_UNLOCK (videoscale); - - structure = gst_caps_get_structure (caps, 0); - ret = gst_caps_copy (caps); structure = gst_structure_copy (gst_caps_get_structure (ret, 0)); @@ -382,7 +374,7 @@ gst_video_scale_transform_caps (GstBaseTransform * trans, gst_caps_merge_structure (ret, gst_structure_copy (structure)); /* if pixel aspect ratio, make a range of it */ - if ((par = gst_structure_get_value (structure, "pixel-aspect-ratio"))) { + if (gst_structure_get_value (structure, "pixel-aspect-ratio")) { gst_structure_set (structure, "pixel-aspect-ratio", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); diff --git a/gst/videoscale/vs_image.c b/gst/videoscale/vs_image.c index 4991d73..afbcf4c 100644 --- a/gst/videoscale/vs_image.c +++ b/gst/videoscale/vs_image.c @@ -43,7 +43,6 @@ vs_image_scale_nearest_RGBA (const VSImage * dest, const VSImage * src, int x_increment; int i; int j; - int x; int xacc; if (dest->height == 1) @@ -60,7 +59,6 @@ vs_image_scale_nearest_RGBA (const VSImage * dest, const VSImage * src, acc = 0; for (i = 0; i < dest->height; i++) { j = acc >> 16; - x = acc & 0xffff; xacc = 0; vs_scanline_resample_nearest_RGBA (dest->pixels + i * dest->stride, @@ -175,7 +173,6 @@ vs_image_scale_nearest_RGB (const VSImage * dest, const VSImage * src, int x_increment; int i; int j; - int x; int xacc; if (dest->height == 1) @@ -191,7 +188,6 @@ vs_image_scale_nearest_RGB (const VSImage * dest, const VSImage * src, acc = 0; for (i = 0; i < dest->height; i++) { j = acc >> 16; - x = acc & 0xffff; xacc = 0; vs_scanline_resample_nearest_RGB (dest->pixels + i * dest->stride, @@ -307,7 +303,6 @@ vs_image_scale_nearest_YUYV (const VSImage * dest, const VSImage * src, int x_increment; int i; int j; - int x; int xacc; if (dest->height == 1) @@ -323,7 +318,6 @@ vs_image_scale_nearest_YUYV (const VSImage * dest, const VSImage * src, acc = 0; for (i = 0; i < dest->height; i++) { j = acc >> 16; - x = acc & 0xffff; xacc = 0; vs_scanline_resample_nearest_YUYV (dest->pixels + i * dest->stride, @@ -439,7 +433,6 @@ vs_image_scale_nearest_UYVY (const VSImage * dest, const VSImage * src, int x_increment; int i; int j; - int x; int xacc; if (dest->height == 1) @@ -455,7 +448,6 @@ vs_image_scale_nearest_UYVY (const VSImage * dest, const VSImage * src, acc = 0; for (i = 0; i < dest->height; i++) { j = acc >> 16; - x = acc & 0xffff; xacc = 0; vs_scanline_resample_nearest_UYVY (dest->pixels + i * dest->stride, @@ -571,7 +563,6 @@ vs_image_scale_nearest_Y (const VSImage * dest, const VSImage * src, int x_increment; int i; int j; - int x; int xacc; if (dest->height == 1) @@ -587,7 +578,6 @@ vs_image_scale_nearest_Y (const VSImage * dest, const VSImage * src, acc = 0; for (i = 0; i < dest->height; i++) { j = acc >> 16; - x = acc & 0xffff; xacc = 0; vs_scanline_resample_nearest_Y (dest->pixels + i * dest->stride, @@ -701,7 +691,6 @@ vs_image_scale_nearest_Y16 (const VSImage * dest, const VSImage * src, int x_increment; int i; int j; - int x; int xacc; if (dest->height == 1) @@ -717,7 +706,6 @@ vs_image_scale_nearest_Y16 (const VSImage * dest, const VSImage * src, acc = 0; for (i = 0; i < dest->height; i++) { j = acc >> 16; - x = acc & 0xffff; xacc = 0; vs_scanline_resample_nearest_Y16 (dest->pixels + i * dest->stride, @@ -833,7 +821,6 @@ vs_image_scale_nearest_RGB565 (const VSImage * dest, const VSImage * src, int x_increment; int i; int j; - int x; int xacc; if (dest->height == 1) @@ -849,7 +836,6 @@ vs_image_scale_nearest_RGB565 (const VSImage * dest, const VSImage * src, acc = 0; for (i = 0; i < dest->height; i++) { j = acc >> 16; - x = acc & 0xffff; xacc = 0; vs_scanline_resample_nearest_RGB565 (dest->pixels + i * dest->stride, @@ -965,7 +951,6 @@ vs_image_scale_nearest_RGB555 (const VSImage * dest, const VSImage * src, int x_increment; int i; int j; - int x; int xacc; if (dest->height == 1) @@ -981,7 +966,6 @@ vs_image_scale_nearest_RGB555 (const VSImage * dest, const VSImage * src, acc = 0; for (i = 0; i < dest->height; i++) { j = acc >> 16; - x = acc & 0xffff; xacc = 0; vs_scanline_resample_nearest_RGB555 (dest->pixels + i * dest->stride, diff --git a/gst/videotestsrc/gstvideotestsrc.c b/gst/videotestsrc/gstvideotestsrc.c index 8072234..9942cbd 100644 --- a/gst/videotestsrc/gstvideotestsrc.c +++ b/gst/videotestsrc/gstvideotestsrc.c @@ -491,9 +491,6 @@ static GstCaps * gst_video_test_src_getcaps (GstBaseSrc * bsrc) { static GstCaps *capslist = NULL; - GstVideoTestSrc *videotestsrc; - - videotestsrc = GST_VIDEO_TEST_SRC (bsrc); if (!capslist) { GstCaps *caps;