diff options
Diffstat (limited to 'src/lib/audio_content.cc')
| -rw-r--r-- | src/lib/audio_content.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc index 2b402991c..7a4ca63a9 100644 --- a/src/lib/audio_content.cc +++ b/src/lib/audio_content.cc @@ -58,8 +58,19 @@ AudioContent::AudioContent (Content* parent) } shared_ptr<AudioContent> -AudioContent::from_xml (Content* parent, cxml::ConstNodePtr node) +AudioContent::from_xml (Content* parent, cxml::ConstNodePtr node, int version) { + if (version < 34) { + /* With old metadata FFmpeg content has the audio-related tags even with no + audio streams, so check for that. + */ + if (node->string_child("Type") == "FFmpeg" && node->node_children("AudioStream").empty()) { + return shared_ptr<AudioContent> (); + } + + /* Otherwise we can drop through to the newer logic */ + } + if (!node->optional_number_child<double> ("AudioGain")) { return shared_ptr<AudioContent> (); } |
