mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-03-16 20:43:42 +00:00
refactoring
This commit is contained in:
@@ -170,7 +170,7 @@ int us_audio_get_encoded(us_audio_s *audio, uint8_t *data, size_t *size, uint64_
|
|||||||
if (ri < 0) {
|
if (ri < 0) {
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
_enc_buffer_s *const buf = audio->enc_ring->items[ri];
|
const _enc_buffer_s *const buf = audio->enc_ring->items[ri];
|
||||||
if (*size < buf->used) {
|
if (*size < buf->used) {
|
||||||
us_ring_consumer_release(audio->enc_ring, ri);
|
us_ring_consumer_release(audio->enc_ring, ri);
|
||||||
return -3;
|
return -3;
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ static void *_video_rtp_thread(void *arg) {
|
|||||||
while (!_STOP) {
|
while (!_STOP) {
|
||||||
const int ri = us_ring_consumer_acquire(_g_video_ring, 0.1);
|
const int ri = us_ring_consumer_acquire(_g_video_ring, 0.1);
|
||||||
if (ri >= 0) {
|
if (ri >= 0) {
|
||||||
us_frame_s *frame = _g_video_ring->items[ri];
|
const us_frame_s *const frame = _g_video_ring->items[ri];
|
||||||
_LOCK_VIDEO;
|
_LOCK_VIDEO;
|
||||||
const bool zero_playout_delay = (frame->gop == 0);
|
const bool zero_playout_delay = (frame->gop == 0);
|
||||||
us_rtpv_wrap(_g_rtpv, frame, zero_playout_delay);
|
us_rtpv_wrap(_g_rtpv, frame, zero_playout_delay);
|
||||||
|
|||||||
Reference in New Issue
Block a user