*/
+#include "compose.hpp"
#include "subtitle.h"
#include "dcp_time.h"
bool
-Subtitle::equals(shared_ptr<const Subtitle> other, EqualityOptions, NoteHandler note) const
+Subtitle::equals(shared_ptr<const Subtitle> other, EqualityOptions options, NoteHandler note) const
{
bool same = true;
same = false;
}
- if (v_position() != other->v_position()) {
- note(NoteType::ERROR, "subtitle vertical positions differ");
+ auto const vpos = std::abs(v_position() - other->v_position());
+ if (vpos > options.max_subtitle_vertical_position_error) {
+ note(
+ NoteType::ERROR,
+ String::compose("subtitle vertical positions differ by %1 (more than the allowed difference of %2)", vpos, options.max_subtitle_vertical_position_error)
+ );
same = false;
}
bool keep_going = false;
/** true to save the first pair of differeng image subtitles to the current working directory */
bool export_differing_subtitles = false;
+ /** The maximum allowable absolute difference between the vertical position of subtitles */
+ float max_subtitle_vertical_position_error = 0;
};