summaryrefslogtreecommitdiff
path: root/gst/audiotestsrc
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2015-11-02 15:54:19 +0100
committerWim Taymans <wtaymans@redhat.com>2015-11-02 15:54:19 +0100
commitbd89f2430bd34f57808f3cf67185db1b647ad128 (patch)
treeb9ad76ffc2203cb54ae582004313a5a31367514f /gst/audiotestsrc
parentc688eb0d887056cd5d6471c139b9847e9e987bd3 (diff)
downloadgstreamer-plugins-base-bd89f2430bd34f57808f3cf67185db1b647ad128.tar.gz
audiotestsrc: increase freq limit
Raise the frequency limit and try to negotiate to a samplerate of 4*freq when larger then the default samplerate. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=754450
Diffstat (limited to 'gst/audiotestsrc')
-rw-r--r--gst/audiotestsrc/gstaudiotestsrc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gst/audiotestsrc/gstaudiotestsrc.c b/gst/audiotestsrc/gstaudiotestsrc.c
index c5ab4c466..15cb4a3d9 100644
--- a/gst/audiotestsrc/gstaudiotestsrc.c
+++ b/gst/audiotestsrc/gstaudiotestsrc.c
@@ -180,8 +180,9 @@ gst_audio_test_src_class_init (GstAudioTestSrcClass * klass)
GST_TYPE_AUDIO_TEST_SRC_WAVE, GST_AUDIO_TEST_SRC_WAVE_SINE,
G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_FREQ,
- g_param_spec_double ("freq", "Frequency", "Frequency of test signal",
- 0.0, 20000.0, DEFAULT_FREQ,
+ g_param_spec_double ("freq", "Frequency", "Frequency of test signal. "
+ "The sample rate needs to be at least 4 times higher.",
+ 0.0, (gdouble) G_MAXINT / 4, DEFAULT_FREQ,
G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_VOLUME,
g_param_spec_double ("volume", "Volume", "Volume of test signal", 0.0,
@@ -267,7 +268,7 @@ gst_audio_test_src_fixate (GstBaseSrc * bsrc, GstCaps * caps)
{
GstAudioTestSrc *src = GST_AUDIO_TEST_SRC (bsrc);
GstStructure *structure;
- gint channels;
+ gint channels, rate;
caps = gst_caps_make_writable (caps);
@@ -275,8 +276,8 @@ gst_audio_test_src_fixate (GstBaseSrc * bsrc, GstCaps * caps)
GST_DEBUG_OBJECT (src, "fixating samplerate to %d", GST_AUDIO_DEF_RATE);
- gst_structure_fixate_field_nearest_int (structure, "rate",
- GST_AUDIO_DEF_RATE);
+ rate = MAX (GST_AUDIO_DEF_RATE, src->freq * 4);
+ gst_structure_fixate_field_nearest_int (structure, "rate", rate);
gst_structure_fixate_field_string (structure, "format", DEFAULT_FORMAT_STR);