From 20b87e39e963d4c6c9cd21572e7839987a36f332 Mon Sep 17 00:00:00 2001 From: Timo Wischer Date: Wed, 6 Oct 2021 16:00:56 +0200 Subject: [PATCH] avtpsrc: Retry receive with same buffer size Without this patch in case of a retry recv() will be called with a negative size argument. Signed-off-by: Timo Wischer Part-of: --- subprojects/gst-plugins-bad/ext/avtp/gstavtpsrc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-bad/ext/avtp/gstavtpsrc.c b/subprojects/gst-plugins-bad/ext/avtp/gstavtpsrc.c index a8ec28a..07a571d 100644 --- a/subprojects/gst-plugins-bad/ext/avtp/gstavtpsrc.c +++ b/subprojects/gst-plugins-bad/ext/avtp/gstavtpsrc.c @@ -272,6 +272,7 @@ gst_avtp_src_fill (GstPushSrc * pushsrc, GstBuffer * buffer) GstMapInfo map; gsize buffer_size; ssize_t n = MAX_AVTPDU_SIZE; + ssize_t received = -1; GstAvtpSrc *avtpsrc = GST_AVTP_SRC (pushsrc); buffer_size = gst_buffer_get_size (buffer); @@ -290,8 +291,8 @@ gst_avtp_src_fill (GstPushSrc * pushsrc, GstBuffer * buffer) retry: errno = 0; - n = recv (avtpsrc->sk_fd, map.data, n, 0); - if (n < 0) { + received = recv (avtpsrc->sk_fd, map.data, n, 0); + if (received < 0) { if (errno == EINTR) { goto retry; } -- 2.7.4