mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 03:00:35 +00:00
audiotestsrc: update blocksize when caps or samples-per-buffer change
Blocksize needs to be updated so we get a correct size buffer on _fill function.
This commit is contained in:
parent
05ad8a3432
commit
6eb5f5b13e
1 changed files with 4 additions and 0 deletions
|
@ -290,6 +290,8 @@ gst_audio_test_src_setcaps (GstBaseSrc * basesrc, GstCaps * caps)
|
|||
|
||||
src->info = info;
|
||||
|
||||
gst_base_src_set_blocksize (basesrc,
|
||||
GST_AUDIO_INFO_BPF (&info) * src->samples_per_buffer);
|
||||
gst_audio_test_src_change_wave (src);
|
||||
|
||||
return TRUE;
|
||||
|
@ -1211,6 +1213,8 @@ gst_audio_test_src_set_property (GObject * object, guint prop_id,
|
|||
switch (prop_id) {
|
||||
case PROP_SAMPLES_PER_BUFFER:
|
||||
src->samples_per_buffer = g_value_get_int (value);
|
||||
gst_base_src_set_blocksize (GST_BASE_SRC_CAST (src),
|
||||
GST_AUDIO_INFO_BPF (&src->info) * src->samples_per_buffer);
|
||||
break;
|
||||
case PROP_WAVE:
|
||||
src->wave = g_value_get_enum (value);
|
||||
|
|
Loading…
Reference in a new issue