[vlc-commits] sout: decklink: don't schedule too much audio ahead
Francois Cartegnie
git at videolan.org
Tue Oct 2 18:46:05 CEST 2018
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Oct 2 14:22:01 2018 +0200| [fb0ffde4258bbbb0a3d72d4e918387ba4952b79a] | committer: Francois Cartegnie
sout: decklink: don't schedule too much audio ahead
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fb0ffde4258bbbb0a3d72d4e918387ba4952b79a
---
modules/stream_out/sdi/DBMSDIOutput.cpp | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/modules/stream_out/sdi/DBMSDIOutput.cpp b/modules/stream_out/sdi/DBMSDIOutput.cpp
index a5a947b13e..6aad020a2d 100644
--- a/modules/stream_out/sdi/DBMSDIOutput.cpp
+++ b/modules/stream_out/sdi/DBMSDIOutput.cpp
@@ -503,15 +503,18 @@ int DBMSDIOutput::Process()
picture_t *p;
while((p = reinterpret_cast<picture_t *>(videoBuffer.Dequeue())))
- ProcessVideo(p, reinterpret_cast<block_t *>(captionsBuffer.Dequeue()));
-
- while(audioMultiplex->availableSamples() >= SAMPLES_PER_FRAME)
{
- block_t *out = audioMultiplex->Extract(SAMPLES_PER_FRAME);
- if(out)
- {
- ProcessAudio(out);
- }
+ while(audioMultiplex->availableSamples() >= SAMPLES_PER_FRAME &&
+ audioMultiplex->bufferStart() <= p->date)
+ {
+ block_t *out = audioMultiplex->Extract(SAMPLES_PER_FRAME);
+ if(out)
+ {
+ ProcessAudio(out);
+ }
+ }
+
+ ProcessVideo(p, reinterpret_cast<block_t *>(captionsBuffer.Dequeue()));
}
return VLC_SUCCESS;
More information about the vlc-commits
mailing list