From 6a68c87b19bc86dfbd5095cf0eff9faea371a819 Mon Sep 17 00:00:00 2001 From: Michael Tretter Date: Thu, 9 Nov 2023 10:22:10 +0100 Subject: [PATCH] gst/pipewiresink: remove special case for size 0 There is no need for a special case with size 0. If size is 0, we can also write the size instead of 0 to the buffer. --- src/gst/gstpipewiresink.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/gst/gstpipewiresink.c b/src/gst/gstpipewiresink.c index 0e970f197..ba70a32e5 100644 --- a/src/gst/gstpipewiresink.c +++ b/src/gst/gstpipewiresink.c @@ -244,14 +244,9 @@ pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink) spa_pod_builder_init (&b, buffer, sizeof (buffer)); spa_pod_builder_push_object (&b, &f, SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers); - if (size == 0) - spa_pod_builder_add (&b, - SPA_PARAM_BUFFERS_size, SPA_POD_CHOICE_RANGE_Int(0, 0, INT32_MAX), - 0); - else - spa_pod_builder_add (&b, - SPA_PARAM_BUFFERS_size, SPA_POD_CHOICE_RANGE_Int(size, size, INT32_MAX), - 0); + spa_pod_builder_add (&b, + SPA_PARAM_BUFFERS_size, SPA_POD_CHOICE_RANGE_Int(size, size, INT32_MAX), + 0); spa_pod_builder_add (&b, SPA_PARAM_BUFFERS_stride, SPA_POD_CHOICE_RANGE_Int(0, 0, INT32_MAX),