Speculative fix for reel length errors when some trimmed content comes in the 2nd...
authorCarl Hetherington <cth@carlh.net>
Thu, 7 Jun 2018 00:52:13 +0000 (01:52 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 7 Jun 2018 00:52:13 +0000 (01:52 +0100)
src/lib/player.cc

index 7e0186bf42e71cf307f6a2548f5add40ddc06c63..c94e0b549602eff985ff1318208f60471ffe7bee 100644 (file)
@@ -557,7 +557,11 @@ Player::pass ()
                        continue;
                }
 
-               DCPTime const t = content_time_to_dcp (i, i->decoder->position());
+               /** decoder position may need to be trimmed like the
+                   content (but the decoder does not know it yet);
+                   check for that and fake it here if necessary.
+               */
+               DCPTime const t = content_time_to_dcp (i, min(i->decoder->position(), i->content->trim_start()));
                if (t > i->content->end()) {
                        i->done = true;
                } else {