summaryrefslogtreecommitdiff
path: root/gst/audiovisualizers/gstspacescope.c
diff options
context:
space:
mode:
authorStefan Sauer <ensonic@users.sf.net>2011-11-24 19:03:23 +0100
committerStefan Sauer <ensonic@users.sf.net>2011-11-24 19:04:17 +0100
commitc61f85da82e1d0bb2b12d9b49b6c508f402f9c74 (patch)
tree0bdac24f5acbb9115a544a4e512157c679e77381 /gst/audiovisualizers/gstspacescope.c
parent78337fc198429e704ac7c4e9582ef26c4fcfa066 (diff)
downloadgstreamer-plugins-bad-c61f85da82e1d0bb2b12d9b49b6c508f402f9c74.tar.gz
audiovisualizers: add aa-line code and user for wave/space-scope
Diffstat (limited to 'gst/audiovisualizers/gstspacescope.c')
-rw-r--r--gst/audiovisualizers/gstspacescope.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gst/audiovisualizers/gstspacescope.c b/gst/audiovisualizers/gstspacescope.c
index f7b7f7d30..101d0a9ae 100644
--- a/gst/audiovisualizers/gstspacescope.c
+++ b/gst/audiovisualizers/gstspacescope.c
@@ -214,20 +214,21 @@ render_lines (GstBaseAudioVisualizer * scope, guint32 * vdata, gint16 * adata,
guint i, s, x, y, ox, oy;
gfloat dx, dy;
guint w = scope->width;
+ guint h = scope->height;
gint x2, y2;
/* draw lines 1st channel x, 2nd channel y */
- dx = scope->width / 65536.0;
- ox = scope->width / 2;
- dy = scope->height / 65536.0;
- oy = scope->height / 2;
+ dx = (w - 1) / 65536.0;
+ ox = (w - 1) / 2;
+ dy = (h - 1) / 65536.0;
+ oy = (h - 1) / 2;
s = 0;
x2 = (guint) (ox + (gfloat) adata[s++] * dx);
y2 = (guint) (oy + (gfloat) adata[s++] * dy);
for (i = 1; i < num_samples; i++) {
x = (guint) (ox + (gfloat) adata[s++] * dx);
y = (guint) (oy + (gfloat) adata[s++] * dy);
- draw_line (vdata, x2, x, y2, y, w, 0x00FFFFFF);
+ draw_line_aa (vdata, x2, x, y2, y, w, 0x00FFFFFF);
x2 = x;
y2 = y;
}