X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fffmpeg_content.cc;h=d15f3fd26a8fcbe47175fdb23e966964a1bd5d51;hb=bb0a36c3a6bea9cd1ebdde7b8a3a04765e317569;hp=a51cb3de805cdcdefe8910e9c8bade812601441d;hpb=40b3ced17b7fff8badfaa8ec2201a8186cdc7dc2;p=dcpomatic.git diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index a51cb3de8..d15f3fd26 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -21,6 +21,7 @@ extern "C" { #include } #include +#include #include "ffmpeg_content.h" #include "ffmpeg_examiner.h" #include "compose.hpp" @@ -40,8 +41,8 @@ using std::list; using std::cout; using std::pair; using boost::shared_ptr; -using boost::lexical_cast; using boost::dynamic_pointer_cast; +using libdcp::raw_convert; int const FFmpegContentProperty::SUBTITLE_STREAMS = 100; int const FFmpegContentProperty::SUBTITLE_STREAM = 101; @@ -58,7 +59,7 @@ FFmpegContent::FFmpegContent (shared_ptr f, boost::filesystem::path } -FFmpegContent::FFmpegContent (shared_ptr f, shared_ptr node, int version, list& notes) +FFmpegContent::FFmpegContent (shared_ptr f, cxml::ConstNodePtr node, int version, list& notes) : Content (f, node) , VideoContent (f, node, version) , AudioContent (f, node) @@ -152,7 +153,7 @@ FFmpegContent::as_xml (xmlpp::Node* node) const } if (_first_video) { - node->add_child("FirstVideo")->add_child_text (lexical_cast (_first_video.get().get())); + node->add_child("FirstVideo")->add_child_text (raw_convert (_first_video.get().get())); } } @@ -311,7 +312,7 @@ operator!= (FFmpegStream const & a, FFmpegStream const & b) return a._id != b._id; } -FFmpegStream::FFmpegStream (shared_ptr node) +FFmpegStream::FFmpegStream (cxml::ConstNodePtr node) : name (node->string_child ("Name")) , _id (node->number_child ("Id")) { @@ -322,10 +323,10 @@ void FFmpegStream::as_xml (xmlpp::Node* root) const { root->add_child("Name")->add_child_text (name); - root->add_child("Id")->add_child_text (lexical_cast (_id)); + root->add_child("Id")->add_child_text (raw_convert (_id)); } -FFmpegAudioStream::FFmpegAudioStream (shared_ptr node, int version) +FFmpegAudioStream::FFmpegAudioStream (cxml::ConstNodePtr node, int version) : FFmpegStream (node) , mapping (node->node_child ("Mapping"), version) { @@ -338,10 +339,10 @@ void FFmpegAudioStream::as_xml (xmlpp::Node* root) const { FFmpegStream::as_xml (root); - root->add_child("FrameRate")->add_child_text (lexical_cast (frame_rate)); - root->add_child("Channels")->add_child_text (lexical_cast (channels)); + root->add_child("FrameRate")->add_child_text (raw_convert (frame_rate)); + root->add_child("Channels")->add_child_text (raw_convert (channels)); if (first_audio) { - root->add_child("FirstAudio")->add_child_text (lexical_cast (first_audio.get().get())); + root->add_child("FirstAudio")->add_child_text (raw_convert (first_audio.get().get())); } mapping.as_xml (root->add_child("Mapping")); } @@ -379,7 +380,7 @@ FFmpegStream::stream (AVFormatContext const * fc) const * @param t String returned from to_string(). * @param v State file version. */ -FFmpegSubtitleStream::FFmpegSubtitleStream (shared_ptr node) +FFmpegSubtitleStream::FFmpegSubtitleStream (cxml::ConstNodePtr node) : FFmpegStream (node) {