summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-05-11 13:48:58 +0200
committerCarl Hetherington <cth@carlh.net>2023-05-12 22:11:06 +0200
commitff02c27b53222592e394d7cde1c904b27a211488 (patch)
treebb23a4f0063307db68cccf1f5ec26589e527acc2
parent2f0b79afd2110617fe694745a65b2350a448bd77 (diff)
add_fonts_from_examiner() can be called multiple times with the same font
in the case of closed captions with multiple tracks. Don't reuse the same font objects in this case, otherwise we will start with something like font, disambiguate it to 0_font, then disambiguate _that_ to 0_0_font.
-rw-r--r--src/lib/dcp_content.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc
index cad775b24..7d835e618 100644
--- a/src/lib/dcp_content.cc
+++ b/src/lib/dcp_content.cc
@@ -831,8 +831,9 @@ add_fonts_from_examiner(shared_ptr<TextContent> text, vector<vector<shared_ptr<F
* by prepending the reel number. We do the same disambiguation when emitting the
* subtitles in the DCP decoder.
*/
- font->set_id(id_for_font_in_reel(font->id(), reel_number));
- text->add_font(font);
+ auto font_copy = make_shared<dcpomatic::Font>(*font);
+ font_copy->set_id(id_for_font_in_reel(font->id(), reel_number));
+ text->add_font(font_copy);
}
++reel_number;
}