audiobuffersplit: Don't try to output anything if samples_per_buffer == 0
This happens if we had no CAPS event yet but e.g. got an EOS event. We
would then try to output a 0-sized buffer, but getting that from the
adapter will give an assertion, return NULL and then crash.
diff --git a/gst/audiobuffersplit/gstaudiobuffersplit.c b/gst/audiobuffersplit/gstaudiobuffersplit.c
index c6c7c9c..3b35267 100644
--- a/gst/audiobuffersplit/gstaudiobuffersplit.c
+++ b/gst/audiobuffersplit/gstaudiobuffersplit.c
@@ -220,6 +220,7 @@
self->resync_time = GST_CLOCK_TIME_NONE;
self->current_offset = -1;
self->accumulated_error = 0;
+ self->samples_per_buffer = 0;
break;
default:
break;
@@ -252,6 +253,9 @@
rate = GST_AUDIO_INFO_RATE (&self->info);
bpf = GST_AUDIO_INFO_BPF (&self->info);
+ if (self->samples_per_buffer == 0)
+ return GST_FLOW_NOT_NEGOTIATED;
+
size = self->samples_per_buffer * bpf;
/* If we accumulated enough error for one sample, include one