X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fffmpeg_content.cc;h=394c16aa53568c4b55fe4e13be3bf0818bb28504;hb=e8204f55c981493b99814f71a50b3c3d62601032;hp=68132c5abf94bea8aedd52196b8520712b0c1e8c;hpb=46cd0fe7b5b514f0d9456b25f670679cc584a218;p=dcpomatic.git diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 68132c5ab..394c16aa5 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -17,6 +17,9 @@ */ +extern "C" { +#include +} #include #include "ffmpeg_content.h" #include "ffmpeg_examiner.h" @@ -26,6 +29,7 @@ #include "filter.h" #include "film.h" #include "log.h" +#include "exceptions.h" #include "i18n.h" @@ -34,8 +38,10 @@ using std::stringstream; using std::vector; using std::list; using std::cout; +using std::pair; using boost::shared_ptr; using boost::lexical_cast; +using boost::dynamic_pointer_cast; int const FFmpegContentProperty::SUBTITLE_STREAMS = 100; int const FFmpegContentProperty::SUBTITLE_STREAM = 101; @@ -47,49 +53,66 @@ FFmpegContent::FFmpegContent (shared_ptr f, boost::filesystem::path : Content (f, p) , VideoContent (f, p) , AudioContent (f, p) + , SubtitleContent (f, p) { } -FFmpegContent::FFmpegContent (shared_ptr f, shared_ptr node) +FFmpegContent::FFmpegContent (shared_ptr f, shared_ptr node, int version) : Content (f, node) , VideoContent (f, node) , AudioContent (f, node) + , SubtitleContent (f, node) { - list > c = node->node_children ("SubtitleStream"); - for (list >::const_iterator i = c.begin(); i != c.end(); ++i) { - _subtitle_streams.push_back (shared_ptr (new FFmpegSubtitleStream (*i))); + list c = node->node_children ("SubtitleStream"); + for (list::const_iterator i = c.begin(); i != c.end(); ++i) { + _subtitle_streams.push_back (shared_ptr (new FFmpegSubtitleStream (*i, version))); if ((*i)->optional_number_child ("Selected")) { _subtitle_stream = _subtitle_streams.back (); } } c = node->node_children ("AudioStream"); - for (list >::const_iterator i = c.begin(); i != c.end(); ++i) { - _audio_streams.push_back (shared_ptr (new FFmpegAudioStream (*i))); + for (list::const_iterator i = c.begin(); i != c.end(); ++i) { + _audio_streams.push_back (shared_ptr (new FFmpegAudioStream (*i, version))); if ((*i)->optional_number_child ("Selected")) { _audio_stream = _audio_streams.back (); } } c = node->node_children ("Filter"); - for (list >::iterator i = c.begin(); i != c.end(); ++i) { + for (list::iterator i = c.begin(); i != c.end(); ++i) { _filters.push_back (Filter::from_id ((*i)->content ())); } - _first_video = node->optional_number_child