From 62c12efaff503fc6e7e41a50382f985eb2239d5f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 28 Jan 2025 17:19:07 +0100 Subject: Fix failure to reset horizontal alignment after a .srt subtitles (DoM #2960). --- src/subrip_reader.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/subrip_reader.cc') 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 ()> 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 (); -- cgit v1.2.3