DeckLink cap.: return audio even if there is no video

This allows to keep the audio stream intact even if video pipeline is
struggling without dropping audio frames.
This commit is contained in:
Martin Pulec
2020-07-29 13:47:49 +02:00
parent a465f681f8
commit c1a1f83b99

View File

@@ -1623,7 +1623,7 @@ vidcap_decklink_grab(void *state, struct audio_frame **audio)
}
*/
return NULL;
frame_ready = false;
}
}
@@ -1635,6 +1635,8 @@ vidcap_decklink_grab(void *state, struct audio_frame **audio)
s->state[i].delegate->newFrameReady = 0;
}
*audio = process_new_audio_packets(s); // return audio even if there is no video to avoid
// hoarding and then dropping of audio packets
// UNLOCK - UNLOCK - UNLOCK - UNLOCK - UNLOCK - UNLOCK - UNLOCK - UNLOCK - UN //
lk.unlock();
@@ -1677,10 +1679,6 @@ vidcap_decklink_grab(void *state, struct audio_frame **audio)
if (count == s->devices_cnt) {
s->frames++;
lk.lock();
*audio = process_new_audio_packets(s);
lk.unlock();
struct timeval t;
gettimeofday(&t, NULL);
double seconds = tv_diff(t, s->t0);