audiobuffersplit: Combine two if expressions to reduce indentation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2780>
This commit is contained in:
Sebastian Dröge 2022-07-21 13:38:22 +03:00 committed by GStreamer Marge Bot
parent 0cadd10474
commit 0485c354d2

View file

@ -540,8 +540,7 @@ gst_audio_buffer_split_handle_discont (GstAudioBufferSplit * self,
avail_samples, GST_SECOND, rate * self->in_segment.rate);
}
if (self->gapless) {
if (self->current_offset != -1) {
if (self->gapless && self->current_offset != -1) {
GST_DEBUG_OBJECT (self,
"Got discont in gapless mode: Current running time %" GST_TIME_FORMAT
", current end running time %" GST_TIME_FORMAT
@ -581,8 +580,7 @@ gst_audio_buffer_split_handle_discont (GstAudioBufferSplit * self,
} else {
GST_DEBUG_OBJECT (self,
"Inserting %" G_GUINT64_FORMAT " samples of silence (%"
GST_TIME_FORMAT ")", silence_samples,
GST_TIME_ARGS (silence_time));
GST_TIME_FORMAT ")", silence_samples, GST_TIME_ARGS (silence_time));
/* Insert silence buffers to fill the gap in 1s chunks */
while (silence_samples > 0) {
@ -608,8 +606,7 @@ gst_audio_buffer_split_handle_discont (GstAudioBufferSplit * self,
discont = FALSE;
}
} else if (new_offset < self->current_offset + avail_samples) {
guint64 drop_samples =
self->current_offset + avail_samples - new_offset;
guint64 drop_samples = self->current_offset + avail_samples - new_offset;
GST_DEBUG_OBJECT (self,
"Dropping %" G_GUINT64_FORMAT " samples (%" GST_TIME_FORMAT ")",
@ -619,7 +616,6 @@ gst_audio_buffer_split_handle_discont (GstAudioBufferSplit * self,
discont = FALSE;
}
}
}
if (discont) {
/* We might end up in here also in gapless mode, if the above code decided