Cleanup: use an early return.
authorCarl Hetherington <cth@carlh.net>
Fri, 20 Jan 2023 21:37:18 +0000 (22:37 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 27 Feb 2023 13:47:25 +0000 (14:47 +0100)
src/lib/analyse_subtitles_job.cc

index 7f1b8ad04d9fe50cfe3ea6c041b89a7b95643407..f0dacf36bf0b829c86bce347f560264776b20fe4 100644 (file)
@@ -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);
                }
        }
 }