Rename SafeStringStream -> locked_stringstream. Bump deps for removal of stringstream.
[dcpomatic.git] / src / lib / content.cc
index b8e7f8ad2910623e8736334b46ad98b8845a61e2..a56573ed28536503e4099a7bdd88c44ebb23604f 100644 (file)
 #include "content_factory.h"
 #include "exceptions.h"
 #include "film.h"
-#include "safe_stringstream.h"
 #include "job.h"
 #include "compose.hpp"
 #include "raw_convert.h"
+#include <locked_sstream.h>
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
 #include <boost/thread/mutex.hpp>
@@ -161,10 +161,10 @@ Content::examine (shared_ptr<Job> job)
        lm.unlock ();
 
        /* Some content files are very big, so we use a poor man's
-          digest here: a MD5 of the first and last 1e6 bytes with the
+          digest here: a digest of the first and last 1e6 bytes with the
           size of the first file tacked on the end as a string.
        */
-       string const d = md5_digest_head_tail (p, 1000000) + raw_convert<string> (boost::filesystem::file_size (p.front ()));
+       string const d = digest_head_tail (p, 1000000) + raw_convert<string> (boost::filesystem::file_size (p.front ()));
 
        lm.lock ();
        _digest = d;
@@ -254,7 +254,7 @@ Content::length_after_trim () const
 string
 Content::identifier () const
 {
-       SafeStringStream s;
+       locked_stringstream s;
 
        s << Content::digest()
          << "_" << position().get()
@@ -362,10 +362,24 @@ Content::add_properties (list<UserProperty>& p) const
        p.push_back (UserProperty (UserProperty::GENERAL, _("Filename"), path(0).string ()));
 
        if (_video_frame_rate) {
-               p.push_back (
-                       UserProperty (
-                               UserProperty::GENERAL, _("Video frame rate"), raw_convert<string> (_video_frame_rate.get(), 5), _("frames per second")
-                               )
-                       );
+               if (video) {
+                       p.push_back (
+                               UserProperty (
+                                       UserProperty::VIDEO,
+                                       _("Frame rate"),
+                                       raw_convert<string> (_video_frame_rate.get(), 5),
+                                       _("frames per second")
+                                       )
+                               );
+               } else {
+                       p.push_back (
+                               UserProperty (
+                                       UserProperty::GENERAL,
+                                       _("Prepared for video frame rate"),
+                                       raw_convert<string> (_video_frame_rate.get(), 5),
+                                       _("frames per second")
+                                       )
+                               );
+               }
        }
 }