summaryrefslogtreecommitdiffstats
path: root/gst/modplug
diff options
context:
space:
mode:
authorBenjamin Otte <otte@gnome.org>2004-03-14 10:33:44 +0000
committerBenjamin Otte <otte@gnome.org>2004-03-14 10:33:44 +0000
commit7dc81ddbcce806c74f57890577ee49dc300b8dde (patch)
tree6d1eab30e0dfad834a28604c9055be25edce3562 /gst/modplug
parentca3eaf9764e93cd7e8b71181b074948de1c11269 (diff)
downloadgst-plugins-bad-7dc81ddbcce806c74f57890577ee49dc300b8dde.tar.gz
gst-plugins-bad-7dc81ddbcce806c74f57890577ee49dc300b8dde.tar.bz2
gst-plugins-bad-7dc81ddbcce806c74f57890577ee49dc300b8dde.zip
move gstreamer-gconf pkgconfig files to pkgconfig/ dir. Make sure they get rebuilt properly
Original commit message from CVS: * configure.ac: * gst-libs/gst/gconf/Makefile.am: * pkgconfig/Makefile.am: move gstreamer-gconf pkgconfig files to pkgconfig/ dir. Make sure they get rebuilt properly * configure.ac: when checking for vorbis, try pkgconfig first. * gst/modplug/gstmodplug.cc: add fixate function
Diffstat (limited to 'gst/modplug')
-rw-r--r--gst/modplug/gstmodplug.cc23
1 files changed, 21 insertions, 2 deletions
diff --git a/gst/modplug/gstmodplug.cc b/gst/modplug/gstmodplug.cc
index 9ebd8563..c4f143d5 100644
--- a/gst/modplug/gstmodplug.cc
+++ b/gst/modplug/gstmodplug.cc
@@ -118,6 +118,7 @@ static void gst_modplug_get_property (GObject *object,
GParamSpec *pspec );
static GstPadLinkReturn
gst_modplug_srclink (GstPad *pad, const GstCaps *caps);
+static GstCaps *gst_modplug_fixate (GstPad *pad, const GstCaps *caps);
static void gst_modplug_loop (GstElement *element);
static void gst_modplug_setup (GstModPlug *modplug);
static const GstFormat *
@@ -240,13 +241,13 @@ gst_modplug_init (GstModPlug *modplug)
gst_element_add_pad (GST_ELEMENT(modplug), modplug->sinkpad);
modplug->srcpad = gst_pad_new_from_template (gst_static_pad_template_get (&modplug_src_template_factory), "src");
- gst_element_add_pad (GST_ELEMENT(modplug), modplug->srcpad);
gst_pad_set_link_function (modplug->srcpad, gst_modplug_srclink);
-
+ gst_pad_set_fixate_function (modplug->srcpad, gst_modplug_fixate);
gst_pad_set_event_function (modplug->srcpad, (GstPadEventFunction)GST_DEBUG_FUNCPTR(gst_modplug_src_event));
gst_pad_set_query_function (modplug->srcpad, gst_modplug_src_query);
gst_pad_set_query_type_function (modplug->srcpad, (GstPadQueryTypeFunction) GST_DEBUG_FUNCPTR (gst_modplug_get_query_types));
gst_pad_set_formats_function (modplug->srcpad, (GstPadFormatsFunction)GST_DEBUG_FUNCPTR (gst_modplug_get_formats));
+ gst_element_add_pad (GST_ELEMENT(modplug), modplug->srcpad);
gst_element_set_loop_function (GST_ELEMENT (modplug), gst_modplug_loop);
@@ -462,6 +463,24 @@ gst_modplug_srclink (GstPad *pad, const GstCaps *caps)
return GST_PAD_LINK_OK;
}
+static GstCaps *
+gst_modplug_fixate (GstPad *pad, const GstCaps *caps)
+{
+ if (gst_caps_is_simple (caps)) {
+ GstCaps *copy;
+ GstStructure *structure;
+
+ copy = gst_caps_copy (caps);
+ structure = gst_caps_get_structure (copy, 0);
+ if (gst_caps_structure_fixate_field_nearest_int (structure, "rate", 44100))
+ return copy;
+ if (gst_caps_structure_fixate_field_nearest_int (structure, "channels", 2))
+ return copy;
+ gst_caps_free (copy);
+ }
+ return NULL;
+}
+
static void
gst_modplug_handle_event (GstModPlug *modplug)
{