From 455391ac3f12adc640e82e9105dbd786a4926902 Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Sat, 29 Jun 2019 20:42:32 +0300
Subject: [PATCH] Minor fix for net grab on create

---
 components/rgbd-sources/src/net.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/components/rgbd-sources/src/net.cpp b/components/rgbd-sources/src/net.cpp
index ad034adf2..8667be5fc 100644
--- a/components/rgbd-sources/src/net.cpp
+++ b/components/rgbd-sources/src/net.cpp
@@ -158,11 +158,11 @@ void NetSource::_updateURI() {
 			_recvChunk(frame, chunk, delta, jpg, d);
 		});
 
-		N_ = 10;
+		N_ = 1;
 
 		// Initiate stream with request for first 10 frames
 		try {
-			host_->getNet()->send(peer_, "get_stream", *uri, 10, 0, host_->getNet()->id(), *uri);
+			host_->getNet()->send(peer_, "get_stream", *uri, N_, 0, host_->getNet()->id(), *uri);
 		} catch(...) {
 			LOG(ERROR) << "Could not connect to stream " << *uri;
 		}
@@ -188,7 +188,7 @@ bool NetSource::grab() {
 	// Send one frame before end to prevent unwanted pause
 	if (N_ <= 2) {
 		N_ = 10;
-		if (!host_->getNet()->send(peer_, "get_stream", *host_->get<string>("uri"), 10, 0, host_->getNet()->id(), *host_->get<string>("uri"))) {
+		if (!host_->getNet()->send(peer_, "get_stream", *host_->get<string>("uri"), N_, 0, host_->getNet()->id(), *host_->get<string>("uri"))) {
 			active_ = false;
 		}
 	}
-- 
GitLab