#include "dcp_decoder.h"
#include "subtitle_content.h"
#include <dcp/dcp.h>
+#include <dcp/raw_convert.h>
#include <dcp/exceptions.h>
#include <dcp/reel_picture_asset.h>
#include <dcp/reel.h>
using boost::scoped_ptr;
using boost::optional;
using boost::function;
+using dcp::raw_convert;
int const DCPContentProperty::CAN_BE_PLAYED = 600;
int const DCPContentProperty::REFERENCE_VIDEO = 601;
AudioStreamPtr (
new AudioStream (
node->number_child<int> ("AudioFrameRate"),
- node->number_child<Frame> ("AudioLength"),
+ /* AudioLength was not present in some old metadata versions */
+ node->optional_number_child<Frame>("AudioLength").get_value_or (
+ video->length() * node->number_child<int>("AudioFrameRate") / video_frame_rate().get()
+ ),
AudioMapping (node->node_child ("AudioMapping"), version)
)
)
string
DCPContent::identifier () const
{
- SafeStringStream s;
- s << Content::identifier() << "_" << video->identifier() << "_";
+ string s = Content::identifier() + "_" + video->identifier() + "_";
if (subtitle) {
- s << subtitle->identifier () << " ";
+ s += subtitle->identifier () + " ";
}
- s << (_reference_video ? "1" : "0")
- << (_reference_subtitle ? "1" : "0");
- return s.str ();
+
+ s += string (_reference_video ? "1" : "0") + string (_reference_subtitle ? "1" : "0");
+ return s;
}
void