From: Wim Taymans Date: Mon, 2 Nov 2015 14:54:19 +0000 (+0100) Subject: audiotestsrc: increase freq limit X-Git-Tag: 1.19.3~511^2~3251 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bd89f2430bd34f57808f3cf67185db1b647ad128;p=platform%2Fupstream%2Fgstreamer.git 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 --- diff --git a/gst/audiotestsrc/gstaudiotestsrc.c b/gst/audiotestsrc/gstaudiotestsrc.c index c5ab4c4..15cb4a3 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);