Fix handling of empty font IDs and default DCP fonts (#2721) (part of #2722).
authorCarl Hetherington <cth@carlh.net>
Sat, 13 Jan 2024 22:34:35 +0000 (23:34 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 15 Jan 2024 09:21:59 +0000 (10:21 +0100)
commitdb22f81ccce9e1a5f205e6d8b3c0631fc039a173
tree263c2a28165fe5d3cf03bae25d19cd60b0640bfd
parent7a301e22de2a3c47a81ebc4c9f19b68131b482aa
Fix handling of empty font IDs and default DCP fonts (#2721) (part of #2722).

Previously we used an empty font ID as the default for when a subtitle
has no Font, but in #2721 we saw a DCP with an empty font ID which
raised an assertion (because we'd already added our default font with
the empty ID).

Here we try to fix this (and also make the default font correctly be
that from the first <LoadFont>).
13 files changed:
src/lib/dcp_decoder.cc
src/lib/dcp_examiner.cc
src/lib/dcp_examiner.h
src/lib/dcp_subtitle_content.cc
src/lib/dcp_subtitle_content.h
src/lib/dcp_subtitle_decoder.cc
src/lib/dcp_subtitle_decoder.h
src/lib/font_id_allocator.cc
src/lib/font_id_allocator.h
test/data
test/dcp_subtitle_test.cc
test/hints_test.cc
test/subtitle_font_id_test.cc