mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 23:36:38 +00:00
audiobuffersplit: Combine two if expressions to reduce indentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2780>
This commit is contained in:
parent
0cadd10474
commit
0485c354d2
1 changed files with 62 additions and 66 deletions
|
@ -540,8 +540,7 @@ gst_audio_buffer_split_handle_discont (GstAudioBufferSplit * self,
|
||||||
avail_samples, GST_SECOND, rate * self->in_segment.rate);
|
avail_samples, GST_SECOND, rate * self->in_segment.rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self->gapless) {
|
if (self->gapless && self->current_offset != -1) {
|
||||||
if (self->current_offset != -1) {
|
|
||||||
GST_DEBUG_OBJECT (self,
|
GST_DEBUG_OBJECT (self,
|
||||||
"Got discont in gapless mode: Current running time %" GST_TIME_FORMAT
|
"Got discont in gapless mode: Current running time %" GST_TIME_FORMAT
|
||||||
", current end 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 {
|
} else {
|
||||||
GST_DEBUG_OBJECT (self,
|
GST_DEBUG_OBJECT (self,
|
||||||
"Inserting %" G_GUINT64_FORMAT " samples of silence (%"
|
"Inserting %" G_GUINT64_FORMAT " samples of silence (%"
|
||||||
GST_TIME_FORMAT ")", silence_samples,
|
GST_TIME_FORMAT ")", silence_samples, GST_TIME_ARGS (silence_time));
|
||||||
GST_TIME_ARGS (silence_time));
|
|
||||||
|
|
||||||
/* Insert silence buffers to fill the gap in 1s chunks */
|
/* Insert silence buffers to fill the gap in 1s chunks */
|
||||||
while (silence_samples > 0) {
|
while (silence_samples > 0) {
|
||||||
|
@ -608,8 +606,7 @@ gst_audio_buffer_split_handle_discont (GstAudioBufferSplit * self,
|
||||||
discont = FALSE;
|
discont = FALSE;
|
||||||
}
|
}
|
||||||
} else if (new_offset < self->current_offset + avail_samples) {
|
} else if (new_offset < self->current_offset + avail_samples) {
|
||||||
guint64 drop_samples =
|
guint64 drop_samples = self->current_offset + avail_samples - new_offset;
|
||||||
self->current_offset + avail_samples - new_offset;
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self,
|
GST_DEBUG_OBJECT (self,
|
||||||
"Dropping %" G_GUINT64_FORMAT " samples (%" GST_TIME_FORMAT ")",
|
"Dropping %" G_GUINT64_FORMAT " samples (%" GST_TIME_FORMAT ")",
|
||||||
|
@ -619,7 +616,6 @@ gst_audio_buffer_split_handle_discont (GstAudioBufferSplit * self,
|
||||||
discont = FALSE;
|
discont = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (discont) {
|
if (discont) {
|
||||||
/* We might end up in here also in gapless mode, if the above code decided
|
/* We might end up in here also in gapless mode, if the above code decided
|
||||||
|
|
Loading…
Reference in a new issue