summaryrefslogtreecommitdiff
path: root/src/lib/dcp_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-01-09 23:52:20 +0000
committerCarl Hetherington <cth@carlh.net>2020-01-10 01:01:03 +0100
commitefc3486f2acf36bd0dc7b5528e7b3110ea8c4afe (patch)
tree261e3ae7c57d130aabe679beacd1fb9adc5d8ba6 /src/lib/dcp_decoder.cc
parent75e31f6b26b2c0775c51fe83938aab7ccbb2684b (diff)
Give DCPDecoder its own ::position which just returns its internal
_next time. This is important because Decoder::position does the wrong thing with DCPs in the following case. 1. DCPDecoder emits a subtitle event (start/stop) at time t. 2. There follows a long time T with no subtitle events. During this time the DCPDecoder's position is reported as t (since TextDecoder notes its position as the time of the last thing it emitted --- which is all it reasonably can do, I think). 3. During this T the DCPDecoder may be incorrectly pass()ed because its position is reported as earlier than it really is; this results in video/audio being emitted by the DCPDecoder but other contemporary sources may not be pass()ed. The upshot of this can be that no audio is emitted, as a contemporary audio source is not pass()ed and hence the merger is waiting for audio that will take a long time to come. When the butler is running this can result in audio underruns as the video buffers overflow with no sign of any audio. It is also simpler this way; DCPDecoder was already maintaining the required information.
Diffstat (limited to 'src/lib/dcp_decoder.cc')
-rw-r--r--src/lib/dcp_decoder.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc
index a3c42a321..03ac66e94 100644
--- a/src/lib/dcp_decoder.cc
+++ b/src/lib/dcp_decoder.cc
@@ -457,3 +457,9 @@ DCPDecoder::calculate_lazy_digest (shared_ptr<const DCPContent> c) const
}
return d.get ();
}
+
+ContentTime
+DCPDecoder::position () const
+{
+ return ContentTime::from_frames(_offset, _dcp_content->active_video_frame_rate(film())) + _next;
+}