diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2016-02-27 20:32:45 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2016-02-27 20:32:45 +0200 |
commit | bd0d2a3d7de8149dd4840a882fdcfa09d663d5d4 (patch) | |
tree | 7c92c75d112e0ffbfae3f4c8034484759355f11a /gst/goom/gstgoom.c | |
parent | cc6e102643c1bae928316dca9f34db028fb9a67e (diff) | |
download | gstreamer-plugins-good-bd0d2a3d7de8149dd4840a882fdcfa09d663d5d4.tar.gz |
Revert "goom: Initialize the goom struct only once we know width/height and recreate it if those change"
This reverts commit cc6e102643c1bae928316dca9f34db028fb9a67e.
Diffstat (limited to 'gst/goom/gstgoom.c')
-rw-r--r-- | gst/goom/gstgoom.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/gst/goom/gstgoom.c b/gst/goom/gstgoom.c index a941ab07a..6700f75c9 100644 --- a/gst/goom/gstgoom.c +++ b/gst/goom/gstgoom.c @@ -50,6 +50,9 @@ GST_DEBUG_CATEGORY (goom_debug); #define GST_CAT_DEFAULT goom_debug +#define DEFAULT_WIDTH 320 +#define DEFAULT_HEIGHT 240 + /* signals and args */ enum { @@ -126,9 +129,11 @@ gst_goom_class_init (GstGoomClass * klass) static void gst_goom_init (GstGoom * goom) { - goom->width = -1; - goom->height = -1; + goom->width = DEFAULT_WIDTH; + goom->height = DEFAULT_HEIGHT; goom->channels = 0; + + goom->plugin = goom_init (goom->width, goom->height); } static void @@ -147,15 +152,8 @@ gst_goom_setup (GstAudioVisualizer * base) { GstGoom *goom = GST_GOOM (base); - if (!goom->plugin || - goom->width != GST_VIDEO_INFO_WIDTH (&base->vinfo) || - goom->height != GST_VIDEO_INFO_HEIGHT (&base->vinfo)) { - goom->width = GST_VIDEO_INFO_WIDTH (&base->vinfo); - goom->height = GST_VIDEO_INFO_HEIGHT (&base->vinfo); - if (goom->plugin) - goom_close (goom->plugin); - goom->plugin = goom_init (goom->width, goom->height); - } + goom->width = GST_VIDEO_INFO_WIDTH (&base->vinfo); + goom->height = GST_VIDEO_INFO_HEIGHT (&base->vinfo); return TRUE; } @@ -170,9 +168,6 @@ gst_goom_render (GstAudioVisualizer * base, GstBuffer * audio, gint16 *adata; gint i; - if (!goom->plugin) - return FALSE; - /* get next GOOM_SAMPLES, we have at least this amount of samples */ gst_buffer_map (audio, &amap, GST_MAP_READ); adata = (gint16 *) amap.data; |