]> git.sesse.net Git - nageru/blobdiff - futatabi/player.cpp
Log a warning when we kill a client that is not keeping up.
[nageru] / futatabi / player.cpp
index 910377a8236fb3a323bdc1b4559328b50725e5fe..94438a0c9713dff414bbff2f3594f6666ff38b11 100644 (file)
@@ -274,8 +274,11 @@ void Player::play_playlist_once()
 
                                FrameOnDisk frame_lower, frame_upper;
                                bool ok = find_surrounding_frames(in_pts_secondary, secondary_stream_idx, &frame_lower, &frame_upper);
+
                                if (ok) {
                                        secondary_frame = frame_lower;
+                               } else {
+                                       secondary_stream_idx = -1;
                                }
                        }
 
@@ -628,7 +631,7 @@ TimeRemaining compute_time_left(const vector<ClipWithID> &clips, size_t currentl
        for (size_t row = currently_playing_idx; row < clips.size(); ++row) {
                const Clip &clip = clips[row].clip;
                double clip_length = double(clip.pts_out - clip.pts_in) / TIMEBASE / clip.speed;
-               if (clip_length >= 86400.0) {  // More than one day.
+               if (clip_length >= 86400.0 || clip.pts_out == -1) {  // More than one day.
                        ++remaining.num_infinite;
                } else {
                        if (row == currently_playing_idx) {