If param loss_threshold is 0, we don't close the stream connection when receiving a NDIlib_frame_type_none

This commit is contained in:
Daniel Vilar 2018-12-05 16:13:36 +01:00
parent 192253ab05
commit 9df0a01a0c
2 changed files with 2 additions and 2 deletions

View file

@ -391,7 +391,7 @@ impl BaseSrcImpl<BaseSrc> for NdiAudioSrc {
while skip_frame {
let frame_type =
NDIlib_recv_capture_v2(pNDI_recv, ptr::null(), &audio_frame, ptr::null(), 1000);
if frame_type == NDIlib_frame_type_e::NDIlib_frame_type_none
if (frame_type == NDIlib_frame_type_e::NDIlib_frame_type_none && _settings.loss_threshold != 0)
|| frame_type == NDIlib_frame_type_e::NDIlib_frame_type_error
{
if count_frame_none < _settings.loss_threshold{

View file

@ -395,7 +395,7 @@ impl BaseSrcImpl<BaseSrc> for NdiVideoSrc {
while skip_frame {
let frame_type =
NDIlib_recv_capture_v2(pNDI_recv, &video_frame, ptr::null(), ptr::null(), 1000);
if frame_type == NDIlib_frame_type_e::NDIlib_frame_type_none
if (frame_type == NDIlib_frame_type_e::NDIlib_frame_type_none && _settings.loss_threshold != 0)
|| frame_type == NDIlib_frame_type_e::NDIlib_frame_type_error
{
if count_frame_none < _settings.loss_threshold{