summaryrefslogtreecommitdiff
path: root/src/lib/dcp_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-12-16 23:00:12 +0000
committerCarl Hetherington <cth@carlh.net>2019-12-17 00:03:11 +0100
commit5be0db4041bdfc469668de290e44ff5443708cf6 (patch)
tree4beccaa25dee40d3729b0a8431f1400023ae689f /src/lib/dcp_decoder.cc
parentf35edd74c46c0291fee6d39dba1c73bac688c849 (diff)
Flush audio decoder when a DCPDecoder finishes so that
resamplers are emptied and hence we don't lose any samples. Fixes #1691. Back-ported from 1444299fa4582fc65c5237edd6c115921f20f872 in master.
Diffstat (limited to 'src/lib/dcp_decoder.cc')
-rw-r--r--src/lib/dcp_decoder.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc
index 826b4e8d3..a3c42a321 100644
--- a/src/lib/dcp_decoder.cc
+++ b/src/lib/dcp_decoder.cc
@@ -125,7 +125,14 @@ DCPDecoder::DCPDecoder (shared_ptr<const Film> film, shared_ptr<const DCPContent
bool
DCPDecoder::pass ()
{
- if (_reel == _reels.end () || !_dcp_content->can_be_played ()) {
+ if (!_dcp_content->can_be_played()) {
+ return true;
+ }
+
+ if (_reel == _reels.end()) {
+ if (audio) {
+ audio->flush ();
+ }
return true;
}