summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-01-20 22:37:18 +0100
committerCarl Hetherington <cth@carlh.net>2023-02-18 00:41:34 +0100
commit513f249f11baf98c5315b89e1e7bad1c988f1433 (patch)
tree8406aef59945c4a1b33aa77a1546e1917a9bad84 /src
parent7e7577624a7b7978ecec3aa0032bc512620c5c26 (diff)
Cleanup: use an early return.
Diffstat (limited to 'src')
-rw-r--r--src/lib/analyse_subtitles_job.cc28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/lib/analyse_subtitles_job.cc b/src/lib/analyse_subtitles_job.cc
index 7f1b8ad04..f0dacf36b 100644
--- a/src/lib/analyse_subtitles_job.cc
+++ b/src/lib/analyse_subtitles_job.cc
@@ -106,19 +106,21 @@ AnalyseSubtitlesJob::analyse (PlayerText text, TextType type)
}
}
- if (!text.string.empty()) {
- /* We can provide dummy values for time and frame rate here as they are only used to calculate fades */
- dcp::Size const frame = _film->frame_size();
- for (auto i: render_text(text.string, frame, dcpomatic::DCPTime(), 24)) {
- dcpomatic::Rect<double> rect (
- double(i.position.x) / frame.width, double(i.position.y) / frame.height,
- double(i.image->size().width) / frame.width, double(i.image->size().height) / frame.height
- );
- if (!_bounding_box) {
- _bounding_box = rect;
- } else {
- _bounding_box->extend (rect);
- }
+ if (text.string.empty()) {
+ return;
+ }
+
+ /* We can provide dummy values for time and frame rate here as they are only used to calculate fades */
+ dcp::Size const frame = _film->frame_size();
+ for (auto i: render_text(text.string, frame, dcpomatic::DCPTime(), 24)) {
+ dcpomatic::Rect<double> rect (
+ double(i.position.x) / frame.width, double(i.position.y) / frame.height,
+ double(i.image->size().width) / frame.width, double(i.image->size().height) / frame.height
+ );
+ if (!_bounding_box) {
+ _bounding_box = rect;
+ } else {
+ _bounding_box->extend (rect);
}
}
}