FIX: left a bracked after unsafe block refactoring

This commit is contained in:
o-reo 2019-03-06 16:16:47 +01:00
parent dc2591ab45
commit 547df0f042
2 changed files with 16 additions and 21 deletions

View file

@ -265,8 +265,7 @@ impl ObjectSubclass for NdiAudioSrc {
gst_debug!(self.cat, obj: element, "NDI audio frame received: {:?}", audio_frame); gst_debug!(self.cat, obj: element, "NDI audio frame received: {:?}", audio_frame);
if receiver.initial_timestamp <= audio_frame.timestamp as u64 if receiver.initial_timestamp <= audio_frame.timestamp as u64
|| receiver.initial_timestamp == 0 || receiver.initial_timestamp == 0 {
{
receiver.initial_timestamp = audio_frame.timestamp as u64; receiver.initial_timestamp = audio_frame.timestamp as u64;
} }
unsafe { unsafe {
@ -274,7 +273,6 @@ impl ObjectSubclass for NdiAudioSrc {
} }
gst_debug!(self.cat, obj: element, "Setting initial timestamp to {}", receiver.initial_timestamp); gst_debug!(self.cat, obj: element, "Setting initial timestamp to {}", receiver.initial_timestamp);
} }
}
self.parent_change_state(element, transition) self.parent_change_state(element, transition)
} }
} }
@ -358,12 +356,10 @@ impl ObjectSubclass for NdiAudioSrc {
let audio_frame: NDIlib_audio_frame_v2_t = Default::default(); let audio_frame: NDIlib_audio_frame_v2_t = Default::default();
unsafe {
unsafe { unsafe {
while NDIlib_recv_capture_v2(pNDI_recv, ptr::null(), &audio_frame, ptr::null(), 1000) while NDIlib_recv_capture_v2(pNDI_recv, ptr::null(), &audio_frame, ptr::null(), 1000)
!= NDIlib_frame_type_e::NDIlib_frame_type_audio {} != NDIlib_frame_type_e::NDIlib_frame_type_audio {}
} }
}
let no_samples = audio_frame.no_samples as u64; let no_samples = audio_frame.no_samples as u64;
let audio_rate = audio_frame.sample_rate; let audio_rate = audio_frame.sample_rate;

View file

@ -283,7 +283,6 @@ impl ObjectSubclass for NdiVideoSrc {
} }
gst_debug!(self.cat, obj: element, "Setting initial timestamp to {}", receiver.initial_timestamp); gst_debug!(self.cat, obj: element, "Setting initial timestamp to {}", receiver.initial_timestamp);
} }
}
self.parent_change_state(element, transition) self.parent_change_state(element, transition)
} }
} }