summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-07-12 15:21:31 +0100
committerCarl Hetherington <cth@carlh.net>2017-07-12 15:21:31 +0100
commit2517ec798da291dedc02dd7a7a432f7aa63133e4 (patch)
tree275fdd498846450725f4400ebb5863ba2a5ac15c /src
parent7698ee82874ee9cb5fa4b251a0a7e7e2df81fcfb (diff)
Add some tests; fix failure to make DCP when there is a bit of audio right at the end of the film (with no corresponding video).
Diffstat (limited to 'src')
-rw-r--r--src/lib/player.cc6
-rw-r--r--src/lib/player.h1
-rw-r--r--src/lib/video_content.cc6
-rw-r--r--src/lib/video_content.h2
4 files changed, 12 insertions, 3 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc
index adaee931e..3ed0e4f45 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -156,8 +156,8 @@ Player::setup_pieces ()
}
}
- _black = Empty (_playlist, bind(&Content::video, _1));
- _silent = Empty (_playlist, bind(&Content::audio, _1));
+ _black = Empty (_film, bind(&Content::video, _1));
+ _silent = Empty (_film, bind(&Content::audio, _1));
_last_video_time = DCPTime ();
_last_audio_time = DCPTime ();
@@ -552,7 +552,7 @@ Player::pass ()
/* Emit any audio that is ready */
- DCPTime pull_to = _playlist->length ();
+ DCPTime pull_to = _film->length ();
for (map<AudioStreamPtr, StreamState>::const_iterator i = _stream_states.begin(); i != _stream_states.end(); ++i) {
if (!i->second.piece->done && i->second.last_push_end < pull_to) {
pull_to = i->second.last_push_end;
diff --git a/src/lib/player.h b/src/lib/player.h
index 230f7f4f8..ee7f89aaa 100644
--- a/src/lib/player.h
+++ b/src/lib/player.h
@@ -89,6 +89,7 @@ private:
friend struct player_time_calculation_test1;
friend struct player_time_calculation_test2;
friend struct player_time_calculation_test3;
+ friend struct player_subframe_test;
void setup_pieces ();
void flush ();
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc
index 30a463089..92219b4c7 100644
--- a/src/lib/video_content.cc
+++ b/src/lib/video_content.cc
@@ -538,3 +538,9 @@ VideoContent::use_template (shared_ptr<const VideoContent> c)
_fade_in = c->_fade_in;
_fade_out = c->_fade_out;
}
+
+void
+VideoContent::modify_position (DCPTime& pos) const
+{
+ pos = pos.ceil (_parent->film()->video_frame_rate());
+}
diff --git a/src/lib/video_content.h b/src/lib/video_content.h
index 623a1858b..19ea113f7 100644
--- a/src/lib/video_content.h
+++ b/src/lib/video_content.h
@@ -168,6 +168,8 @@ public:
void take_from_examiner (boost::shared_ptr<VideoExaminer>);
void add_properties (std::list<UserProperty> &) const;
+ void modify_position (DCPTime& pos) const;
+
static boost::shared_ptr<VideoContent> from_xml (Content* parent, cxml::ConstNodePtr, int);
private: