mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
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
This commit is contained in:
parent
c688eb0d88
commit
bd89f2430b
1 changed files with 6 additions and 5 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue