diff options
Diffstat (limited to 'src/lib/subtitle_content.cc')
| -rw-r--r-- | src/lib/subtitle_content.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/subtitle_content.cc b/src/lib/subtitle_content.cc index a45b0a24f..5b3b453b6 100644 --- a/src/lib/subtitle_content.cc +++ b/src/lib/subtitle_content.cc @@ -69,6 +69,17 @@ SubtitleContent::SubtitleContent (Content* parent) shared_ptr<SubtitleContent> SubtitleContent::from_xml (Content* parent, cxml::ConstNodePtr node, int version) { + if (version < 34) { + /* With old metadata FFmpeg content has the subtitle-related tags even with no + subtitle streams, so check for that. + */ + if (node->string_child("Type") == "FFmpeg" && node->node_children("SubtitleStream").empty()) { + return shared_ptr<SubtitleContent> (); + } + + /* Otherwise we can drop through to the newer logic */ + } + if (!node->optional_number_child<double>("SubtitleXOffset") && !node->optional_number_child<double>("SubtitleOffset")) { return shared_ptr<SubtitleContent> (); } |
