summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-01-28 17:19:07 +0100
committerCarl Hetherington <cth@carlh.net>2025-01-29 02:04:33 +0100
commit62c12efaff503fc6e7e41a50382f985eb2239d5f (patch)
tree438ea4b262be6f69ef8598af03a75875ccd57a7f /src
parented7db4de16af9f6a0e17f4469aed22a8f6fa17e0 (diff)
Fix failure to reset horizontal alignment after a .srt subtitles (DoM #2960).
Diffstat (limited to 'src')
-rw-r--r--src/subrip_reader.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/subrip_reader.cc b/src/subrip_reader.cc
index 7412474..73af9ee 100644
--- a/src/subrip_reader.cc
+++ b/src/subrip_reader.cc
@@ -71,10 +71,14 @@ SubripReader::read (function<optional<string> ()> get_line)
CONTENT
} state = COUNTER;
- RawSubtitle rs;
- rs.vertical_position.line = 0;
- rs.vertical_position.reference = TOP_OF_SUBTITLE;
+ auto prepare = [](RawSubtitle& rs) {
+ rs.vertical_position.line = 0;
+ rs.vertical_position.reference = TOP_OF_SUBTITLE;
+ };
+
+ RawSubtitle rs;
+ prepare(rs);
while (true) {
auto line = get_line ();