diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/subtitle_asset.cc | 23 | ||||
| -rw-r--r-- | src/subtitle_asset_internal.cc | 2 | ||||
| -rw-r--r-- | src/warnings.h | 1 |
3 files changed, 24 insertions, 2 deletions
diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc index bb752441..bf4b1c63 100644 --- a/src/subtitle_asset.cc +++ b/src/subtitle_asset.cc @@ -404,11 +404,31 @@ SubtitleAsset::maybe_add_subtitle (string text, vector<ParseState> const & parse ); break; case ParseState::Type::IMAGE: + { + switch (standard) { + case Standard::INTEROP: + if (text.size() >= 4) { + /* Remove file extension */ + text = text.substr(0, text.size() - 4); + } + break; + case Standard::SMPTE: + /* It looks like this urn:uuid: is required, but DoM wasn't expecting it (and not writing it) + * until around 2.15.140 so I guess either: + * a) it is not (always) used in the field, or + * b) nobody noticed / complained. + */ + if (text.substr(0, 9) == "urn:uuid:") { + text = text.substr(9); + } + break; + } + /* Add a subtitle with no image data and we'll fill that in later */ _subtitles.push_back ( make_shared<SubtitleImage>( ArrayData(), - standard == Standard::INTEROP ? text.substr(0, text.size() - 4) : text, + text, ps.in.get(), ps.out.get(), ps.h_position.get_value_or(0), @@ -421,6 +441,7 @@ SubtitleAsset::maybe_add_subtitle (string text, vector<ParseState> const & parse ); break; } + } } diff --git a/src/subtitle_asset_internal.cc b/src/subtitle_asset_internal.cc index 80e861f1..a9200618 100644 --- a/src/subtitle_asset_internal.cc +++ b/src/subtitle_asset_internal.cc @@ -261,7 +261,7 @@ order::Image::as_xml (xmlpp::Element* parent, Context& context) const position_align (e, context, _h_align, _h_position, _v_align, _v_position); if (context.standard == Standard::SMPTE) { - e->add_child_text (_id); + e->add_child_text ("urn:uuid:" + _id); } else { e->add_child_text (_id + ".png"); } diff --git a/src/warnings.h b/src/warnings.h index e751d9c5..88b4b724 100644 --- a/src/warnings.h +++ b/src/warnings.h @@ -42,6 +42,7 @@ _Pragma("GCC diagnostic ignored \"-Wparentheses\"") \ _Pragma("GCC diagnostic ignored \"-Wdeprecated-copy\"") \ _Pragma("GCC diagnostic ignored \"-Wsuggest-override\"") + _Pragma("GCC diagnostic ignored \"-Wunused-function\"") #else #define LIBDCP_DISABLE_WARNINGS \ _Pragma("GCC diagnostic push") \ |
