mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
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.
This commit is contained in:
parent
4523cff147
commit
5cff156f2c
1 changed files with 4 additions and 0 deletions
|
@ -220,6 +220,7 @@ gst_audio_buffer_split_change_state (GstElement * element,
|
|||
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 @@ gst_audio_buffer_split_output (GstAudioBufferSplit * self, gboolean force)
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue