Player is not finished if it's still filling in blank space.
authorCarl Hetherington <cth@carlh.net>
Mon, 8 May 2017 10:27:14 +0000 (11:27 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 8 May 2017 10:27:14 +0000 (11:27 +0100)
src/lib/player.cc
src/lib/player.h

index 081174acc301acdb90d518b148c7b8747d72bc98..392804ee843001a1841ffb921fb72214c6d64a1d 100644 (file)
@@ -537,13 +537,14 @@ Player::pass ()
                }
        }
 
+       bool filled = false;
        if (_last_video_time) {
-               fill_video (DCPTimePeriod (_last_video_time.get(), earliest ? earliest_content : _playlist->length()));
+               filled = fill_video (DCPTimePeriod (_last_video_time.get(), earliest ? earliest_content : _playlist->length()));
        } else if (_last_seek_time) {
-               fill_video (DCPTimePeriod (_last_seek_time.get(), _last_seek_time.get() + one_video_frame ()));
+               filled = fill_video (DCPTimePeriod (_last_seek_time.get(), _last_seek_time.get() + one_video_frame ()));
        }
 
-       if (!earliest) {
+       if (!earliest && !filled) {
                return true;
        }
 
@@ -934,10 +935,11 @@ Player::resampler (shared_ptr<const AudioContent> content, AudioStreamPtr stream
        return r;
 }
 
-void
+bool
 Player::fill_video (DCPTimePeriod period)
 {
        /* XXX: this may not work for 3D */
+       bool filled = false;
        BOOST_FOREACH (DCPTimePeriod i, subtract(period, _no_video)) {
                for (DCPTime j = i.from; j < i.to; j += one_video_frame()) {
                        if (_playlist->video_content_at(j) && _last_video) {
@@ -945,8 +947,10 @@ Player::fill_video (DCPTimePeriod period)
                        } else {
                                emit_video (black_player_video_frame(), j);
                        }
+                       filled = true;
                }
        }
+       return filled;
 }
 
 void
index ea792d4dab1c8313d394d33da5e9d97e08882243..7cffa1f1137a9b5b100570e4b78cca7eef2c1f05 100644 (file)
@@ -110,7 +110,7 @@ private:
        void subtitle_stop (boost::weak_ptr<Piece>, ContentTime);
        boost::shared_ptr<Resampler> resampler (boost::shared_ptr<const AudioContent> content, AudioStreamPtr stream, bool create);
        DCPTime one_video_frame () const;
-       void fill_video (DCPTimePeriod period);
+       bool fill_video (DCPTimePeriod period);
        void fill_audio (DCPTimePeriod period);
        void audio_flush (boost::shared_ptr<Piece>, AudioStreamPtr stream);
        void audio_transform (boost::shared_ptr<AudioContent> content, AudioStreamPtr stream, ContentAudio content_audio, DCPTime time);