Always update the rendered subtitles for non-dialogue changes

Closes #1770.
This commit is contained in:
Thomas Goyne 2014-06-15 07:10:29 -07:00
parent 23f6addf35
commit 5f9fc95fb4
2 changed files with 6 additions and 6 deletions

View File

@ -111,7 +111,7 @@ void AsyncVideoProvider::LoadSubtitles(const AssFile *new_subs) throw() {
worker->Async([=]{ worker->Async([=]{
subs.reset(copy); subs.reset(copy);
single_frame = NEW_SUBS_FILE; single_frame = NEW_SUBS_FILE;
ProcAsync(req_version); ProcAsync(req_version, false);
}); });
} }
@ -135,7 +135,7 @@ void AsyncVideoProvider::UpdateSubtitles(const AssFile *new_subs, std::set<const
} }
single_frame = NEW_SUBS_FILE; single_frame = NEW_SUBS_FILE;
ProcAsync(req_version); ProcAsync(req_version, true);
}); });
} }
@ -145,7 +145,7 @@ void AsyncVideoProvider::RequestFrame(int new_frame, double new_time) throw() {
worker->Async([=]{ worker->Async([=]{
time = new_time; time = new_time;
frame_number = new_frame; frame_number = new_frame;
ProcAsync(req_version); ProcAsync(req_version, false);
}); });
} }
@ -178,7 +178,7 @@ bool AsyncVideoProvider::NeedUpdate(std::vector<AssDialogueBase const*> const& v
return false; return false;
} }
void AsyncVideoProvider::ProcAsync(uint_fast32_t req_version) { void AsyncVideoProvider::ProcAsync(uint_fast32_t req_version, bool check_updated) {
// Only actually produce the frame if there's no queued changes waiting // Only actually produce the frame if there's no queued changes waiting
if (req_version < version || frame_number < 0) return; if (req_version < version || frame_number < 0) return;
@ -188,7 +188,7 @@ void AsyncVideoProvider::ProcAsync(uint_fast32_t req_version) {
visible_lines.push_back(&line); visible_lines.push_back(&line);
} }
if (!NeedUpdate(visible_lines)) return; if (check_updated && !NeedUpdate(visible_lines)) return;
last_lines.clear(); last_lines.clear();
last_lines.reserve(visible_lines.size()); last_lines.reserve(visible_lines.size());

View File

@ -70,7 +70,7 @@ class AsyncVideoProvider {
std::shared_ptr<VideoFrame> ProcFrame(int frame, double time, bool raw = false); std::shared_ptr<VideoFrame> ProcFrame(int frame, double time, bool raw = false);
/// Produce a frame if req_version is still the current version /// Produce a frame if req_version is still the current version
void ProcAsync(uint_fast32_t req_version); void ProcAsync(uint_fast32_t req_version, bool check_updated);
/// Monotonic counter used to drop frames when changes arrive faster than /// Monotonic counter used to drop frames when changes arrive faster than
/// they can be rendered /// they can be rendered