Merge pull request #1 from teltek/fix_audio_offset

Fix ndiaudiosrc offset
This commit is contained in:
Daniel Vilar 2018-09-24 10:17:05 +02:00 committed by GitHub
commit 86cdb6e5a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -375,9 +375,8 @@ impl BaseSrcImpl<BaseSrc> for NdiAudioSrc {
buffer.set_pts(pts + ndi_struct.start_pts);
buffer.set_duration(duration);
//TODO fix audio offset
buffer.set_offset(timestamp_data.offset);
timestamp_data.offset += 1;
timestamp_data.offset += audio_frame.no_samples as u64/audio_frame.no_channels as u64;
buffer.set_offset_end(timestamp_data.offset);
buffer.copy_from_slice(0, &vec).unwrap();
}