summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorJens Granseuer <jensgr@gmx.net>2008-02-22 05:33:59 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2008-02-22 05:33:59 +0000
commit266e4741cd2c5ddde52fc9d4a7062abd87263da9 (patch)
tree1f74b9b6e0a5876fc014f863dbcbbf3ab59b758e /sys
parent6c322640d53093d0e34961ef8cbaeaac1290ae21 (diff)
downloadgst-plugins-bad-266e4741cd2c5ddde52fc9d4a7062abd87263da9.tar.gz
gst-plugins-bad-266e4741cd2c5ddde52fc9d4a7062abd87263da9.tar.bz2
gst-plugins-bad-266e4741cd2c5ddde52fc9d4a7062abd87263da9.zip
Some C89 fixes, moving variable declarations to the beginning of a block. Fixes bug #517937.
Original commit message from CVS: Patch by: Jens Granseuer <jensgr at gmx dot net> * gst/librfb/gstrfbsrc.c: (gst_rfb_property_set_version): * gst/librfb/rfbdecoder.c: (rfb_decoder_message_set_encodings), (rfb_decoder_state_set_encodings): * gst/mpegtsparse/mpegtspacketizer.c: (mpegts_packetizer_parse_nit), (mpegts_packetizer_parse_sdt), (mpegts_packetizer_parse_eit): * sys/fbdev/gstfbdevsink.c: (gst_fbdevsink_getcaps), (gst_fbdevsink_setcaps), (gst_fbdevsink_render): Some C89 fixes, moving variable declarations to the beginning of a block. Fixes bug #517937.
Diffstat (limited to 'sys')
-rw-r--r--sys/fbdev/gstfbdevsink.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/sys/fbdev/gstfbdevsink.c b/sys/fbdev/gstfbdevsink.c
index 3f5c5026..ec9358a9 100644
--- a/sys/fbdev/gstfbdevsink.c
+++ b/sys/fbdev/gstfbdevsink.c
@@ -136,22 +136,25 @@ static GstCaps *
gst_fbdevsink_getcaps (GstBaseSink * bsink)
{
GstFBDEVSink *fbdevsink;
+ GstCaps *caps;
+ uint32_t rmask;
+ uint32_t gmask;
+ uint32_t bmask;
+ int endianness;
fbdevsink = GST_FBDEVSINK (bsink);
if (!fbdevsink->framebuffer)
return gst_caps_from_string (GST_FBDEV_TEMPLATE_CAPS);
- GstCaps *caps;
-
- uint32_t rmask = ((1 << fbdevsink->varinfo.red.length) - 1)
+ rmask = ((1 << fbdevsink->varinfo.red.length) - 1)
<< fbdevsink->varinfo.red.offset;
- uint32_t gmask = ((1 << fbdevsink->varinfo.green.length) - 1)
+ gmask = ((1 << fbdevsink->varinfo.green.length) - 1)
<< fbdevsink->varinfo.green.offset;
- uint32_t bmask = ((1 << fbdevsink->varinfo.blue.length) - 1)
+ bmask = ((1 << fbdevsink->varinfo.blue.length) - 1)
<< fbdevsink->varinfo.blue.offset;
- int endianness = 0;
+ endianness = 0;
switch (fbdevsink->varinfo.bits_per_pixel) {
case 32:
@@ -199,13 +202,12 @@ gst_fbdevsink_setcaps (GstBaseSink * bsink, GstCaps * vscapslist)
{
GstFBDEVSink *fbdevsink;
GstStructure *structure;
+ const GValue *fps;
fbdevsink = GST_FBDEVSINK (bsink);
structure = gst_caps_get_structure (vscapslist, 0);
- const GValue *fps;
-
fps = gst_structure_get_value (structure, "framerate");
fbdevsink->fps_n = gst_value_get_fraction_numerator (fps);
fbdevsink->fps_d = gst_value_get_fraction_denominator (fps);
@@ -241,13 +243,13 @@ gst_fbdevsink_render (GstBaseSink * bsink, GstBuffer * buf)
{
GstFBDEVSink *fbdevsink;
+ int i;
fbdevsink = GST_FBDEVSINK (bsink);
/* optimization could remove this memcpy by allocating the buffer
in framebuffer memory, but would only work when xres matches
the video width */
- int i;
for (i = 0; i < fbdevsink->lines; i++)
memcpy (fbdevsink->framebuffer