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
@ -220,6 +220,7 @@ gst_audio_buffer_split_change_state (GstElement * element,
|
|||||||
self->resync_time = GST_CLOCK_TIME_NONE;
|
self->resync_time = GST_CLOCK_TIME_NONE;
|
||||||
self->current_offset = -1;
|
self->current_offset = -1;
|
||||||
self->accumulated_error = 0;
|
self->accumulated_error = 0;
|
||||||
|
self->samples_per_buffer = 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -252,6 +253,9 @@ gst_audio_buffer_split_output (GstAudioBufferSplit * self, gboolean force)
|
|||||||
rate = GST_AUDIO_INFO_RATE (&self->info);
|
rate = GST_AUDIO_INFO_RATE (&self->info);
|
||||||
bpf = GST_AUDIO_INFO_BPF (&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;
|
size = self->samples_per_buffer * bpf;
|
||||||
|
|
||||||
/* If we accumulated enough error for one sample, include one
|
/* If we accumulated enough error for one sample, include one
|
||||||
|
Loading…
x
Reference in New Issue
Block a user