Rename SafeStringStream -> locked_stringstream. Bump deps for removal of stringstream.
authorCarl Hetherington <cth@carlh.net>
Fri, 22 Jul 2016 09:06:10 +0000 (10:06 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 22 Jul 2016 09:06:10 +0000 (10:06 +0100)
43 files changed:
cscript
src/lib/analyse_audio_job.cc
src/lib/audio_filter_graph.cc
src/lib/cinema_kdms.cc
src/lib/compose.hpp
src/lib/content.cc
src/lib/dcp_content.cc
src/lib/dcpomatic_time.h
src/lib/digester.cc
src/lib/emailer.cc
src/lib/encode_server.cc
src/lib/encoded_log_entry.cc
src/lib/environment_info.cc
src/lib/ffmpeg_content.cc
src/lib/ffmpeg_examiner.cc
src/lib/film.cc
src/lib/filter_graph.cc
src/lib/image_content.cc
src/lib/internet.cc
src/lib/job.cc
src/lib/json_server.cc
src/lib/log.cc
src/lib/log_entry.cc
src/lib/raw_convert.h
src/lib/safe_stringstream.cc [deleted file]
src/lib/safe_stringstream.h [deleted file]
src/lib/string_log_entry.cc
src/lib/subtitle_content.cc
src/lib/transcode_job.cc
src/lib/update_checker.cc
src/lib/util.cc
src/lib/video_content.cc
src/lib/video_content_scale.cc
src/lib/video_filter_graph.cc
src/lib/wscript
src/tools/dcpomatic.cc
src/tools/dcpomatic_kdm_cli.cc
src/tools/dcpomatic_server.cc
src/wx/colour_conversion_editor.cc
src/wx/dolby_doremi_certificate_panel.cc
src/wx/time_picker.cc
test/test.cc
test/video_content_scale_test.cc

diff --git a/cscript b/cscript
index ef7306aed28c4b790e67178394f7449bf0e78299..44f7bcd8fece494618ba2262e9231e4d3945bfb2 100644 (file)
--- a/cscript
+++ b/cscript
@@ -237,8 +237,8 @@ def dependencies(target):
         ffmpeg_options = {}
 
     return (('ffmpeg-cdist', '1d4a1a4', ffmpeg_options),
         ffmpeg_options = {}
 
     return (('ffmpeg-cdist', '1d4a1a4', ffmpeg_options),
-            ('libdcp', 'v1.3.4'),
-            ('libsub', 'v1.1.13'))
+            ('libdcp', 'b487f83'),
+            ('libsub', '45b8f2f'))
 
 def configure_options(target):
     opt = ''
 
 def configure_options(target):
     opt = ''
index 8d0accf0f62804bd4dfc44604621470774b9d681..3e771d3f6af6a35c1e7a9e6a45b2be48b1b6b1ea 100644 (file)
@@ -169,7 +169,7 @@ AnalyseAudioJob::analyse (shared_ptr<const AudioBuffers> b)
                        float s = data[i];
                        float as = fabsf (s);
                        if (as < 10e-7) {
                        float s = data[i];
                        float as = fabsf (s);
                        if (as < 10e-7) {
-                               /* SafeStringStream can't serialise and recover inf or -inf, so prevent such
+                               /* locked_stringstream can't serialise and recover inf or -inf, so prevent such
                                   values by replacing with this (140dB down) */
                                s = as = 10e-7;
                        }
                                   values by replacing with this (140dB down) */
                                s = as = 10e-7;
                        }
index 87a158a4e356c7af9dd0cd26f19ab6df29668e18..6b70300fce195550eee6b2eec22b83d714ede4e1 100644 (file)
@@ -56,7 +56,7 @@ AudioFilterGraph::~AudioFilterGraph()
 string
 AudioFilterGraph::src_parameters () const
 {
 string
 AudioFilterGraph::src_parameters () const
 {
-       SafeStringStream a;
+       locked_stringstream a;
 
        char buffer[64];
        av_get_channel_layout_string (buffer, sizeof(buffer), 0, _channel_layout);
 
        char buffer[64];
        av_get_channel_layout_string (buffer, sizeof(buffer), 0, _channel_layout);
index 84cd9c18f83a9b6bd6c9665da6eb929b158b4b92..f76c96283710cc7b4bd0e3fea085a29d0d15c3bd 100644 (file)
@@ -136,9 +136,9 @@ CinemaKDMs::email (
                i.make_zip_file (film_name, zip_file);
 
                string subject = config->kdm_subject();
                i.make_zip_file (film_name, zip_file);
 
                string subject = config->kdm_subject();
-               SafeStringStream start;
+               locked_stringstream start;
                start << from.date() << " " << from.time_of_day();
                start << from.date() << " " << from.time_of_day();
-               SafeStringStream end;
+               locked_stringstream end;
                end << to.date() << " " << to.time_of_day();
                boost::algorithm::replace_all (subject, "$CPL_NAME", cpl_name);
                boost::algorithm::replace_all (subject, "$START_TIME", start.str ());
                end << to.date() << " " << to.time_of_day();
                boost::algorithm::replace_all (subject, "$CPL_NAME", cpl_name);
                boost::algorithm::replace_all (subject, "$START_TIME", start.str ());
@@ -151,7 +151,7 @@ CinemaKDMs::email (
                boost::algorithm::replace_all (body, "$END_TIME", end.str ());
                boost::algorithm::replace_all (body, "$CINEMA_NAME", i.cinema->name);
 
                boost::algorithm::replace_all (body, "$END_TIME", end.str ());
                boost::algorithm::replace_all (body, "$CINEMA_NAME", i.cinema->name);
 
-               SafeStringStream screens;
+               locked_stringstream screens;
                BOOST_FOREACH (ScreenKDM const & j, i.screen_kdms) {
                        screens << j.screen->name << ", ";
                }
                BOOST_FOREACH (ScreenKDM const & j, i.screen_kdms) {
                        screens << j.screen->name << ", ";
                }
index aa67b5a1fd8bc9f1027ab272b20c93ff744d8732..ebabe671a7f40545b0a546294a485375de192134 100644 (file)
 #ifndef STRING_COMPOSE_H
 #define STRING_COMPOSE_H
 
 #ifndef STRING_COMPOSE_H
 #define STRING_COMPOSE_H
 
+#include <locked_sstream.h>
 #include <string>
 #include <list>
 #include <map>                 // for multimap
 #include <string>
 #include <list>
 #include <map>                 // for multimap
-#include "safe_stringstream.h"
 
 namespace StringPrivate
 {
 
 namespace StringPrivate
 {
@@ -56,7 +56,7 @@ namespace StringPrivate
     std::string str() const;
 
   private:
     std::string str() const;
 
   private:
-    SafeStringStream os;
+    locked_stringstream os;
     int arg_no;
 
     // we store the output as a list - when the output string is requested, the
     int arg_no;
 
     // we store the output as a list - when the output string is requested, the
@@ -104,7 +104,7 @@ namespace StringPrivate
     case '8':
     case '9':
       return true;
     case '8':
     case '9':
       return true;
-    
+
     default:
       return false;
     }
     default:
       return false;
     }
@@ -118,21 +118,21 @@ namespace StringPrivate
     os << obj;
 
     std::string rep = os.str();
     os << obj;
 
     std::string rep = os.str();
-  
+
     if (!rep.empty()) {                // manipulators don't produce output
       for (specification_map::const_iterator i = specs.lower_bound(arg_no),
             end = specs.upper_bound(arg_no); i != end; ++i) {
        output_list::iterator pos = i->second;
        ++pos;
     if (!rep.empty()) {                // manipulators don't produce output
       for (specification_map::const_iterator i = specs.lower_bound(arg_no),
             end = specs.upper_bound(arg_no); i != end; ++i) {
        output_list::iterator pos = i->second;
        ++pos;
-      
+
        output.insert(pos, rep);
       }
        output.insert(pos, rep);
       }
-    
+
       os.str(std::string());
       //os.clear();
       ++arg_no;
     }
       os.str(std::string());
       //os.clear();
       ++arg_no;
     }
-  
+
     return *this;
   }
 
     return *this;
   }
 
@@ -140,7 +140,7 @@ namespace StringPrivate
     : arg_no(1)
   {
     std::string::size_type b = 0, i = 0;
     : arg_no(1)
   {
     std::string::size_type b = 0, i = 0;
-  
+
     // fill in output with the strings between the %1 %2 %3 etc. and
     // fill in specs with the positions
     while (i < fmt.length()) {
     // fill in output with the strings between the %1 %2 %3 etc. and
     // fill in specs with the positions
     while (i < fmt.length()) {
@@ -152,7 +152,7 @@ namespace StringPrivate
        else if (is_number(fmt[i + 1])) { // aha! a spec!
          // save string
          output.push_back(fmt.substr(b, i - b));
        else if (is_number(fmt[i + 1])) { // aha! a spec!
          // save string
          output.push_back(fmt.substr(b, i - b));
-       
+
          int n = 1;            // number of digits
          int spec_no = 0;
 
          int n = 1;            // number of digits
          int spec_no = 0;
 
@@ -165,9 +165,9 @@ namespace StringPrivate
          spec_no /= 10;
          output_list::iterator pos = output.end();
          --pos;                // safe since we have just inserted a string>
          spec_no /= 10;
          output_list::iterator pos = output.end();
          --pos;                // safe since we have just inserted a string>
-       
+
          specs.insert(specification_map::value_type(spec_no, pos));
          specs.insert(specification_map::value_type(spec_no, pos));
-       
+
          // jump over spec string
          i += n;
          b = i;
          // jump over spec string
          i += n;
          b = i;
@@ -178,7 +178,7 @@ namespace StringPrivate
       else
        ++i;
     }
       else
        ++i;
     }
-  
+
     if (i - b > 0)             // add the rest of the string
       output.push_back(fmt.substr(b, i - b));
   }
     if (i - b > 0)             // add the rest of the string
       output.push_back(fmt.substr(b, i - b));
   }
@@ -187,17 +187,17 @@ namespace StringPrivate
   {
     // assemble string
     std::string str;
   {
     // assemble string
     std::string str;
-  
+
     for (output_list::const_iterator i = output.begin(), end = output.end();
         i != end; ++i)
       str += *i;
     for (output_list::const_iterator i = output.begin(), end = output.end();
         i != end; ++i)
       str += *i;
-  
+
     return str;
   }
 }
 
 // now for the real thing(s)
     return str;
   }
 }
 
 // now for the real thing(s)
-namespace String 
+namespace String
 {
   // a series of functions which accept a format string on the form "text %1
   // more %2 less %3" and a number of templated parameters and spits out the
 {
   // a series of functions which accept a format string on the form "text %1
   // more %2 less %3" and a number of templated parameters and spits out the
@@ -308,7 +308,7 @@ namespace String
       .arg(o10);
     return c.str();
   }
       .arg(o10);
     return c.str();
   }
-  
+
   template <typename T1, typename T2, typename T3, typename T4, typename T5,
            typename T6, typename T7, typename T8, typename T9, typename T10,
            typename T11>
   template <typename T1, typename T2, typename T3, typename T4, typename T5,
            typename T6, typename T7, typename T8, typename T9, typename T10,
            typename T11>
index 95713d323c47b032ab17d7fc132699ca7ba3145b..a56573ed28536503e4099a7bdd88c44ebb23604f 100644 (file)
 #include "content_factory.h"
 #include "exceptions.h"
 #include "film.h"
 #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 "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>
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
 #include <boost/thread/mutex.hpp>
@@ -254,7 +254,7 @@ Content::length_after_trim () const
 string
 Content::identifier () const
 {
 string
 Content::identifier () const
 {
-       SafeStringStream s;
+       locked_stringstream s;
 
        s << Content::digest()
          << "_" << position().get()
 
        s << Content::digest()
          << "_" << position().get()
index ca809df616443c0963e7f5c0dcadfc00dc6bc3ef..431492c7ac29b8b50091d75e1cdbfead4d5e3dac 100644 (file)
@@ -239,7 +239,7 @@ DCPContent::full_length () const
 string
 DCPContent::identifier () const
 {
 string
 DCPContent::identifier () const
 {
-       SafeStringStream s;
+       locked_stringstream s;
        s << Content::identifier() << "_" << video->identifier() << "_";
        if (subtitle) {
                s << subtitle->identifier () << " ";
        s << Content::identifier() << "_" << video->identifier() << "_";
        if (subtitle) {
                s << subtitle->identifier () << " ";
index c538357ccbe12c57093fb59bbc91758f8e1a1138..e6ca493b2bb921e58fbe0fb5c7e7f3c23c9aaf4c 100644 (file)
@@ -26,8 +26,8 @@
 #define DCPOMATIC_TIME_H
 
 #include "frame_rate_change.h"
 #define DCPOMATIC_TIME_H
 
 #include "frame_rate_change.h"
-#include "safe_stringstream.h"
 #include "dcpomatic_assert.h"
 #include "dcpomatic_assert.h"
+#include <locked_sstream.h>
 #include <stdint.h>
 #include <cmath>
 #include <ostream>
 #include <stdint.h>
 #include <cmath>
 #include <ostream>
@@ -181,7 +181,7 @@ public:
                int f;
                split (r, h, m, s, f);
 
                int f;
                split (r, h, m, s, f);
 
-               SafeStringStream o;
+               locked_stringstream o;
                o.width (2);
                o.fill ('0');
                o << std::setw(2) << std::setfill('0') << h << ":"
                o.width (2);
                o.fill ('0');
                o << std::setw(2) << std::setfill('0') << h << ":"
index 66e617de81d371c0d8eaf0196569920d5aac45fe..70c2babf5e4fd6d054a5db9a5f5594d2f49c3848 100644 (file)
@@ -19,7 +19,7 @@
 */
 
 #include "digester.h"
 */
 
 #include "digester.h"
-#include "safe_stringstream.h"
+#include <locked_sstream.h>
 #include <nettle/md5.h>
 #include <iomanip>
 
 #include <nettle/md5.h>
 #include <iomanip>
 
@@ -57,7 +57,7 @@ Digester::get () const
                unsigned char digest[MD5_DIGEST_SIZE];
                md5_digest (&_context, MD5_DIGEST_SIZE, digest);
 
                unsigned char digest[MD5_DIGEST_SIZE];
                md5_digest (&_context, MD5_DIGEST_SIZE, digest);
 
-               SafeStringStream s;
+               locked_stringstream s;
                for (int i = 0; i < MD5_DIGEST_SIZE; ++i) {
                        s << hex << setfill('0') << setw(2) << ((int) digest[i]);
                }
                for (int i = 0; i < MD5_DIGEST_SIZE; ++i) {
                        s << hex << setfill('0') << setw(2) << ((int) digest[i]);
                }
index 5e645457d32f8ed7b99ca4126ba14fb55767960d..71b29db1e06acb42c0fc359ced67bd589197bfee 100644 (file)
@@ -103,7 +103,7 @@ Emailer::send (string server, int port, string user, string password)
        boost::posix_time::time_duration offset = local_now - utc_now;
        sprintf (date_buffer + strlen(date_buffer), "%s%02d%02d", (offset.hours() >= 0 ? "+" : "-"), abs (offset.hours()), offset.minutes());
 
        boost::posix_time::time_duration offset = local_now - utc_now;
        sprintf (date_buffer + strlen(date_buffer), "%s%02d%02d", (offset.hours() >= 0 ? "+" : "-"), abs (offset.hours()), offset.minutes());
 
-       SafeStringStream email;
+       locked_stringstream email;
 
        email << "Date: " << date_buffer << "\r\n"
              << "To: " << address_list (_to) << "\r\n"
 
        email << "Date: " << date_buffer << "\r\n"
              << "To: " << address_list (_to) << "\r\n"
index 7e015200370afaff06b5f75b6606274665a359f5..cf5ec651a99655ba249cb07dccd3c4d019622b59 100644 (file)
 #include "config.h"
 #include "cross.h"
 #include "player_video.h"
 #include "config.h"
 #include "cross.h"
 #include "player_video.h"
-#include "safe_stringstream.h"
 #include "raw_convert.h"
 #include "compose.hpp"
 #include "log.h"
 #include "encoded_log_entry.h"
 #include "raw_convert.h"
 #include "compose.hpp"
 #include "log.h"
 #include "encoded_log_entry.h"
+#include <locked_sstream.h>
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
 #include <boost/algorithm/string.hpp>
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
 #include <boost/algorithm/string.hpp>
index 3409319ac311270dce98f1086cf3ca714d59ca29..84c7a6ca6ba61e252bc731173988ae20b885573b 100644 (file)
@@ -19,7 +19,7 @@
 */
 
 #include "encoded_log_entry.h"
 */
 
 #include "encoded_log_entry.h"
-#include "safe_stringstream.h"
+#include <locked_sstream.h>
 
 using std::string;
 using std::fixed;
 
 using std::string;
 using std::fixed;
@@ -38,7 +38,7 @@ EncodedLogEntry::EncodedLogEntry (int frame, string ip, double receive, double e
 string
 EncodedLogEntry::message () const
 {
 string
 EncodedLogEntry::message () const
 {
-       SafeStringStream m;
+       locked_stringstream m;
        m.precision (2);
        m << fixed
          << "Encoded frame " << _frame << " from " << _ip << ": "
        m.precision (2);
        m << fixed
          << "Encoded frame " << _frame << " from " << _ip << ": "
index 810e24d66e6ee5a1ede5e5aa664c8ca7c6d4ecbd..eb241d512489579d5e7dcc8fff1139d549186fdd 100644 (file)
@@ -57,7 +57,7 @@ static
 string
 ffmpeg_version_to_string (int v)
 {
 string
 ffmpeg_version_to_string (int v)
 {
-       SafeStringStream s;
+       locked_stringstream s;
        s << ((v & 0xff0000) >> 16) << N_(".") << ((v & 0xff00) >> 8) << N_(".") << (v & 0xff);
        return s.str ();
 }
        s << ((v & 0xff0000) >> 16) << N_(".") << ((v & 0xff00) >> 8) << N_(".") << (v & 0xff);
        return s.str ();
 }
@@ -68,7 +68,7 @@ static
 string
 dependency_version_summary ()
 {
 string
 dependency_version_summary ()
 {
-       SafeStringStream s;
+       locked_stringstream s;
        s << N_("libavcodec ") << ffmpeg_version_to_string (avcodec_version()) << N_(", ")
          << N_("libavfilter ") << ffmpeg_version_to_string (avfilter_version()) << N_(", ")
          << N_("libavformat ") << ffmpeg_version_to_string (avformat_version()) << N_(", ")
        s << N_("libavcodec ") << ffmpeg_version_to_string (avcodec_version()) << N_(", ")
          << N_("libavfilter ") << ffmpeg_version_to_string (avfilter_version()) << N_(", ")
          << N_("libavformat ") << ffmpeg_version_to_string (avformat_version()) << N_(", ")
index 76ee663ff14e3bdec4689c546eebaba12e566c84..60c777b3c3d9f6107386525fa211630c14906afc 100644 (file)
@@ -32,9 +32,9 @@
 #include "log.h"
 #include "exceptions.h"
 #include "frame_rate_change.h"
 #include "log.h"
 #include "exceptions.h"
 #include "frame_rate_change.h"
-#include "safe_stringstream.h"
 #include "raw_convert.h"
 #include "subtitle_content.h"
 #include "raw_convert.h"
 #include "subtitle_content.h"
+#include <locked_sstream.h>
 #include <libcxml/cxml.h>
 extern "C" {
 #include <libavformat/avformat.h>
 #include <libcxml/cxml.h>
 extern "C" {
 #include <libavformat/avformat.h>
@@ -388,7 +388,7 @@ FFmpegContent::set_filters (vector<Filter const *> const & filters)
 string
 FFmpegContent::identifier () const
 {
 string
 FFmpegContent::identifier () const
 {
-       SafeStringStream s;
+       locked_stringstream s;
 
        s << Content::identifier();
 
 
        s << Content::identifier();
 
index 18a87f40e591ab0e27d66b88d2677ea75043bae4..544cc11b91fc545d2d74426b5ab372db4933fdd1 100644 (file)
@@ -30,7 +30,7 @@ extern "C" {
 #include "ffmpeg_audio_stream.h"
 #include "ffmpeg_subtitle_stream.h"
 #include "util.h"
 #include "ffmpeg_audio_stream.h"
 #include "ffmpeg_subtitle_stream.h"
 #include "util.h"
-#include "safe_stringstream.h"
+#include <locked_sstream.h>
 #include <boost/foreach.hpp>
 #include <iostream>
 
 #include <boost/foreach.hpp>
 #include <iostream>
 
@@ -351,7 +351,7 @@ FFmpegExaminer::sample_aspect_ratio () const
 string
 FFmpegExaminer::subtitle_stream_name (AVStream* s) const
 {
 string
 FFmpegExaminer::subtitle_stream_name (AVStream* s) const
 {
-       SafeStringStream n;
+       locked_stringstream n;
 
        n << stream_name (s);
 
 
        n << stream_name (s);
 
@@ -365,7 +365,7 @@ FFmpegExaminer::subtitle_stream_name (AVStream* s) const
 string
 FFmpegExaminer::stream_name (AVStream* s) const
 {
 string
 FFmpegExaminer::stream_name (AVStream* s) const
 {
-       SafeStringStream n;
+       locked_stringstream n;
 
        if (s->metadata) {
                AVDictionaryEntry const * lang = av_dict_get (s->metadata, "language", 0, 0);
 
        if (s->metadata) {
                AVDictionaryEntry const * lang = av_dict_get (s->metadata, "language", 0, 0);
index 6764a5be6c175252bf7fec8126a305d65038ae75..0138211cf0c49d823f3357fbdca62108a68dbe2c 100644 (file)
@@ -38,7 +38,6 @@
 #include "dcp_content_type.h"
 #include "ratio.h"
 #include "cross.h"
 #include "dcp_content_type.h"
 #include "ratio.h"
 #include "cross.h"
-#include "safe_stringstream.h"
 #include "environment_info.h"
 #include "raw_convert.h"
 #include "audio_processor.h"
 #include "environment_info.h"
 #include "raw_convert.h"
 #include "audio_processor.h"
@@ -52,6 +51,7 @@
 #include "dcp_content.h"
 #include "screen_kdm.h"
 #include "cinema.h"
 #include "dcp_content.h"
 #include "screen_kdm.h"
 #include "cinema.h"
+#include <locked_sstream.h>
 #include <libcxml/cxml.h>
 #include <dcp/cpl.h>
 #include <dcp/certificate_chain.h>
 #include <libcxml/cxml.h>
 #include <dcp/cpl.h>
 #include <dcp/certificate_chain.h>
@@ -197,7 +197,7 @@ Film::video_identifier () const
 {
        DCPOMATIC_ASSERT (container ());
 
 {
        DCPOMATIC_ASSERT (container ());
 
-       SafeStringStream s;
+       locked_stringstream s;
        s.imbue (std::locale::classic ());
 
        s << container()->id()
        s.imbue (std::locale::classic ());
 
        s << container()->id()
@@ -530,7 +530,7 @@ Film::mapped_audio_channels () const
 string
 Film::isdcf_name (bool if_created_now) const
 {
 string
 Film::isdcf_name (bool if_created_now) const
 {
-       SafeStringStream d;
+       locked_stringstream d;
 
        string raw_name = name ();
 
 
        string raw_name = name ();
 
@@ -922,7 +922,7 @@ Film::j2c_path (int reel, Frame frame, Eyes eyes, bool tmp) const
        p /= "j2c";
        p /= video_identifier ();
 
        p /= "j2c";
        p /= video_identifier ();
 
-       SafeStringStream s;
+       locked_stringstream s;
        s.width (8);
        s << setfill('0') << reel << "_" << frame;
 
        s.width (8);
        s << setfill('0') << reel << "_" << frame;
 
index db89d1695950169854ecd5994736c3deefded034..d918f7dc8cf0d1bd163fa65ae880331a6fd3e86c 100644 (file)
@@ -26,7 +26,7 @@
 #include "filter.h"
 #include "exceptions.h"
 #include "image.h"
 #include "filter.h"
 #include "exceptions.h"
 #include "image.h"
-#include "safe_stringstream.h"
+#include <locked_sstream.h>
 #include "compose.hpp"
 extern "C" {
 #include <libavfilter/avfiltergraph.h>
 #include "compose.hpp"
 extern "C" {
 #include <libavfilter/avfiltergraph.h>
index d4e73677113dd72a64396ae1bb0c6822d1f5fb60..08b9fd6ae475a364dd367f48274ef28e23ebf5d0 100644 (file)
@@ -26,8 +26,8 @@
 #include "job.h"
 #include "frame_rate_change.h"
 #include "exceptions.h"
 #include "job.h"
 #include "frame_rate_change.h"
 #include "exceptions.h"
-#include "safe_stringstream.h"
 #include "image_filename_sorter.h"
 #include "image_filename_sorter.h"
+#include <locked_sstream.h>
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
 #include <boost/foreach.hpp>
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
 #include <boost/foreach.hpp>
@@ -136,7 +136,7 @@ ImageContent::full_length () const
 string
 ImageContent::identifier () const
 {
 string
 ImageContent::identifier () const
 {
-       SafeStringStream s;
+       locked_stringstream s;
        s << Content::identifier();
        s << "_" << video->identifier ();
        s << "_" << video->length();
        s << Content::identifier();
        s << "_" << video->identifier ();
        s << "_" << video->length();
index 5a909e470088470e558a4c0461ce5889dcf96f9e..c0a29bfbdf13cfbc52d93b2e9f1d997fe247832d 100644 (file)
@@ -20,8 +20,8 @@
 
 #include "scoped_temporary.h"
 #include "compose.hpp"
 
 #include "scoped_temporary.h"
 #include "compose.hpp"
-#include "safe_stringstream.h"
 #include "exceptions.h"
 #include "exceptions.h"
+#include <locked_sstream.h>
 #include <curl/curl.h>
 #include <zip.h>
 #include <boost/function.hpp>
 #include <curl/curl.h>
 #include <zip.h>
 #include <boost/function.hpp>
@@ -149,7 +149,7 @@ ftp_ls (string url, bool pasv)
                throw NetworkError (curl_easy_strerror (r));
        }
 
                throw NetworkError (curl_easy_strerror (r));
        }
 
-       SafeStringStream s (ls_raw);
+       locked_stringstream s (ls_raw);
        list<string> ls;
        while (s.good ()) {
                string line = s.getline ();
        list<string> ls;
        while (s.good ()) {
                string line = s.getline ();
index b316cddf7fa2740af8ff0de774d5a425af66107d..585e8fb0d29ace1bdf905fe9ab5fdab691a20fcc 100644 (file)
@@ -376,7 +376,7 @@ Job::status () const
        int const t = elapsed_sub_time ();
        int const r = remaining_time ();
 
        int const t = elapsed_sub_time ();
        int const r = remaining_time ();
 
-       SafeStringStream s;
+       locked_stringstream s;
        if (!finished () && p) {
                int pc = lrintf (p.get() * 100);
                if (pc == 100) {
        if (!finished () && p) {
                int pc = lrintf (p.get() * 100);
                if (pc == 100) {
index 0006201e66c3b6a04bb52d01c4fa222ad55d3a37..4af13387510885d701736bc5a5678bd5f7de4d0f 100644 (file)
@@ -151,7 +151,7 @@ JSONServer::request (string url, shared_ptr<tcp::socket> socket)
                action = r["action"];
        }
 
                action = r["action"];
        }
 
-       SafeStringStream json;
+       locked_stringstream json;
        if (action == "status") {
 
                list<shared_ptr<Job> > jobs = JobManager::instance()->get ();
        if (action == "status") {
 
                list<shared_ptr<Job> > jobs = JobManager::instance()->get ();
@@ -187,7 +187,7 @@ JSONServer::request (string url, shared_ptr<tcp::socket> socket)
                }
        }
 
                }
        }
 
-       SafeStringStream reply;
+       locked_stringstream reply;
        reply << "HTTP/1.1 200 OK\r\n"
              << "Content-Length: " << json.str().length() << "\r\n"
              << "Content-Type: application/json\r\n"
        reply << "HTTP/1.1 200 OK\r\n"
              << "Content-Length: " << json.str().length() << "\r\n"
              << "Content-Type: application/json\r\n"
index b7edd4e29d93d0a0cde0c9c87f1c77e5b11fecea..c8ba74f23615ff5fe2108cecb346f118136add62 100644 (file)
@@ -25,8 +25,8 @@
 #include "log.h"
 #include "cross.h"
 #include "config.h"
 #include "log.h"
 #include "cross.h"
 #include "config.h"
-#include "safe_stringstream.h"
 #include "string_log_entry.h"
 #include "string_log_entry.h"
+#include <locked_sstream.h>
 #include <time.h>
 #include <cstdio>
 
 #include <time.h>
 #include <cstdio>
 
index 50796b69aeafc2fad4219a82ee56f737ee98fdc4..53605c389546e04f139449348e932188241fab79 100644 (file)
@@ -19,7 +19,7 @@
 */
 
 #include "log_entry.h"
 */
 
 #include "log_entry.h"
-#include "safe_stringstream.h"
+#include <locked_sstream.h>
 
 #include "i18n.h"
 
 
 #include "i18n.h"
 
@@ -42,7 +42,7 @@ LogEntry::LogEntry (int type)
 string
 LogEntry::get () const
 {
 string
 LogEntry::get () const
 {
-       SafeStringStream s;
+       locked_stringstream s;
        if (_type & TYPE_TIMING) {
                s << _time.tv_sec << ":" << _time.tv_usec << " ";
        } else {
        if (_type & TYPE_TIMING) {
                s << _time.tv_sec << ":" << _time.tv_usec << " ";
        } else {
index 46b7d0dff846a417c2847700bbe7c8adf97831fe..92d8e3d32a979dd290dd992a5f9d27a45794854f 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef DCPOMATIC_RAW_CONVERT_H
 #define DCPOMATIC_RAW_CONVERT_H
 
 #ifndef DCPOMATIC_RAW_CONVERT_H
 #define DCPOMATIC_RAW_CONVERT_H
 
-#include "safe_stringstream.h"
+#include <locked_sstream.h>
 #include <iomanip>
 
 /** A sort-of version of boost::lexical_cast that does uses the "C"
 #include <iomanip>
 
 /** A sort-of version of boost::lexical_cast that does uses the "C"
@@ -31,7 +31,7 @@ template <typename P, typename Q>
 P
 raw_convert (Q v, int precision = 16)
 {
 P
 raw_convert (Q v, int precision = 16)
 {
-       SafeStringStream s;
+       locked_stringstream s;
        s.imbue (std::locale::classic ());
        s << std::setprecision (precision);
        s << v;
        s.imbue (std::locale::classic ());
        s << std::setprecision (precision);
        s << v;
diff --git a/src/lib/safe_stringstream.cc b/src/lib/safe_stringstream.cc
deleted file mode 100644 (file)
index c8864bd..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-    Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
-
-    This file is part of DCP-o-matic.
-
-    DCP-o-matic is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    DCP-o-matic is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#include <boost/thread/mutex.hpp>
-#include "safe_stringstream.h"
-
-boost::mutex SafeStringStream::_mutex;
diff --git a/src/lib/safe_stringstream.h b/src/lib/safe_stringstream.h
deleted file mode 100644 (file)
index bf8407b..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-    Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
-
-    This file is part of DCP-o-matic.
-
-    DCP-o-matic is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    DCP-o-matic is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef DCPOMATIC_SAFE_STRINGSTREAM_H
-#define DCPOMATIC_SAFE_STRINGSTREAM_H
-
-#include <boost/thread/mutex.hpp>
-
-/* I've not been able to reproduce it, but there have been reports that DCP-o-matic crashes
- * on OS X with two simultaneous backtraces that look like this:
- *
- * 0 libSystem.B.dylib  0x00007fff84ebe264 __numeric_load_locale + 125
- * 1 libSystem.B.dylib  0x00007fff84e2aac4 loadlocale + 323
- * 2 libstdc++.6.dylib  0x00007fff8976ba69 std::__convert_from_v(int* const&, char*, int, char const*, ...) + 199
- * 3 libstdc++.6.dylib  0x00007fff8974e99b std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<char,
-std::char_traits<char> > >::_M_insert_float<double>(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, char, double) const + 199
- * 4 libstdc++.6.dylib  0x00007fff8974ebc0 std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> >
->::do_put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, double) const + 28
- * 5 libstdc++.6.dylib  0x00007fff897566a2 std::ostream& std::ostream::_M_insert<double>(double) + 178
- * 6 libdcpomatic.dylib 0x0000000100331e21 StringPrivate::Composition& StringPrivate::Composition::arg<float>(float const&) + 33
- *
- * in two different threads.  I'm assuming that for some bizarre reason it is unsafe to use two separate stringstream
- * objects in different threads on OS X.  This is a hack to work around it.
- */
-
-class SafeStringStream
-{
-public:
-       SafeStringStream ()
-       {}
-
-       SafeStringStream (std::string s)
-               : _stream (s)
-       {}
-
-       template <class T>
-       std::ostream& operator<< (T val)
-       {
-               boost::mutex::scoped_lock lm (_mutex);
-               _stream << val;
-               return _stream;
-       }
-
-       template <class T>
-       std::istream& operator>> (T& val)
-       {
-               boost::mutex::scoped_lock lm (_mutex);
-               _stream >> val;
-               return _stream;
-       }
-
-       std::string str () const {
-               return _stream.str ();
-       }
-
-       void str (std::string const & s) {
-               _stream.str (s);
-       }
-
-       void imbue (std::locale const & loc)
-       {
-               boost::mutex::scoped_lock lm (_mutex);
-               _stream.imbue (loc);
-       }
-
-       void width (int w)
-       {
-               _stream.width (w);
-       }
-
-       void fill (int f)
-       {
-               _stream.fill (f);
-       }
-
-       void precision (int p)
-       {
-               _stream.precision (p);
-       }
-
-       bool good () const
-       {
-               return _stream.good ();
-       }
-
-       std::string getline ()
-       {
-               boost::mutex::scoped_lock lm (_mutex);
-               std::string s;
-               std::getline (_stream, s);
-               return s;
-       }
-
-       void setf (std::ios_base::fmtflags flags, std::ios_base::fmtflags mask)
-       {
-               _stream.setf (flags, mask);
-       }
-
-private:
-       static boost::mutex _mutex;
-       std::stringstream _stream;
-};
-
-#endif
index 517ca090c21166f62277029348db44a01da1ff73..69c1130fbcb385a3ef42b97b7f043155c7d4eb7c 100644 (file)
@@ -19,7 +19,7 @@
 */
 
 #include "string_log_entry.h"
 */
 
 #include "string_log_entry.h"
-#include "safe_stringstream.h"
+#include <locked_sstream.h>
 
 #include "i18n.h"
 
 
 #include "i18n.h"
 
index 2376aac6898a286e42ebc44b9815ba326acc7b70..422bb65658e9e4a2afc160e1117a37c13d3ac470 100644 (file)
 #include "subtitle_content.h"
 #include "util.h"
 #include "exceptions.h"
 #include "subtitle_content.h"
 #include "util.h"
 #include "exceptions.h"
-#include "safe_stringstream.h"
 #include "font.h"
 #include "raw_convert.h"
 #include "content.h"
 #include "font.h"
 #include "raw_convert.h"
 #include "content.h"
+#include <locked_sstream.h>
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
 #include <boost/foreach.hpp>
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
 #include <boost/foreach.hpp>
@@ -249,7 +249,7 @@ SubtitleContent::as_xml (xmlpp::Node* root) const
 string
 SubtitleContent::identifier () const
 {
 string
 SubtitleContent::identifier () const
 {
-       SafeStringStream s;
+       locked_stringstream s;
        s << raw_convert<string> (x_scale())
          << "_" << raw_convert<string> (y_scale())
          << "_" << raw_convert<string> (x_offset())
        s << raw_convert<string> (x_scale())
          << "_" << raw_convert<string> (y_scale())
          << "_" << raw_convert<string> (x_offset())
index fe7132699cdda7509b5b5420c3a0200957e13a9b..8e56603302e1200382197965d51b8c0cbf0f1ee1 100644 (file)
@@ -28,7 +28,7 @@
 #include "film.h"
 #include "transcoder.h"
 #include "log.h"
 #include "film.h"
 #include "transcoder.h"
 #include "log.h"
-#include "safe_stringstream.h"
+#include <locked_sstream.h>
 #include "compose.hpp"
 #include <iostream>
 #include <iomanip>
 #include "compose.hpp"
 #include <iostream>
 #include <iomanip>
@@ -112,7 +112,7 @@ TranscodeJob::status () const
                return Job::status ();
        }
 
                return Job::status ();
        }
 
-       SafeStringStream s;
+       locked_stringstream s;
 
        s << Job::status ();
 
 
        s << Job::status ();
 
index 58bc7c1b7436d6743615a56a5da7e3176cebe818..e6ee851a0c5202a0c49e947a421f065f6ab5864d 100644 (file)
@@ -20,9 +20,9 @@
 
 #include "update_checker.h"
 #include "version.h"
 
 #include "update_checker.h"
 #include "version.h"
-#include "safe_stringstream.h"
 #include "util.h"
 #include "raw_convert.h"
 #include "util.h"
 #include "raw_convert.h"
+#include <locked_sstream.h>
 #include <libcxml/cxml.h>
 #include <curl/curl.h>
 #include <boost/algorithm/string.hpp>
 #include <libcxml/cxml.h>
 #include <curl/curl.h>
 #include <boost/algorithm/string.hpp>
index f3795c26406c75a6b4e286cde16510a93b2e8ca7..4a0965858eabbf07aa0c156f5714eeb50d2f7ec7 100644 (file)
@@ -35,8 +35,8 @@
 #include "rect.h"
 #include "digester.h"
 #include "audio_processor.h"
 #include "rect.h"
 #include "digester.h"
 #include "audio_processor.h"
-#include "safe_stringstream.h"
 #include "compose.hpp"
 #include "compose.hpp"
+#include <locked_sstream.h>
 #include <dcp/util.h>
 #include <dcp/picture_asset.h>
 #include <dcp/sound_asset.h>
 #include <dcp/util.h>
 #include <dcp/picture_asset.h>
 #include <dcp/sound_asset.h>
@@ -115,7 +115,7 @@ seconds_to_hms (int s)
        int h = m / 60;
        m -= (h * 60);
 
        int h = m / 60;
        m -= (h * 60);
 
-       SafeStringStream hms;
+       locked_stringstream hms;
        hms << h << N_(":");
        hms.width (2);
        hms << setfill ('0') << m << N_(":");
        hms << h << N_(":");
        hms.width (2);
        hms << setfill ('0') << m << N_(":");
@@ -136,7 +136,7 @@ seconds_to_approximate_hms (int s)
        int h = m / 60;
        m -= (h * 60);
 
        int h = m / 60;
        m -= (h * 60);
 
-       SafeStringStream ap;
+       locked_stringstream ap;
 
        bool const hours = h > 0;
        bool const minutes = h < 6 && m > 0;
 
        bool const hours = h > 0;
        bool const minutes = h < 6 && m > 0;
index a59e9669d62de990b6f4b9359476ee17bededcb4..335f8c6dbf75f2a6bae9bda6a97f159d8acb6bf8 100644 (file)
@@ -30,8 +30,8 @@
 #include "exceptions.h"
 #include "frame_rate_change.h"
 #include "log.h"
 #include "exceptions.h"
 #include "frame_rate_change.h"
 #include "log.h"
-#include "safe_stringstream.h"
 #include "raw_convert.h"
 #include "raw_convert.h"
+#include <locked_sstream.h>
 #include <libcxml/cxml.h>
 #include <dcp/colour_matrix.h>
 #include <libxml++/libxml++.h>
 #include <libcxml/cxml.h>
 #include <dcp/colour_matrix.h>
 #include <libxml++/libxml++.h>
@@ -264,7 +264,7 @@ VideoContent::take_from_examiner (shared_ptr<VideoExaminer> d)
 string
 VideoContent::identifier () const
 {
 string
 VideoContent::identifier () const
 {
-       SafeStringStream s;
+       locked_stringstream s;
        s << crop().left
          << "_" << crop().right
          << "_" << crop().top
        s << crop().left
          << "_" << crop().right
          << "_" << crop().top
@@ -377,7 +377,7 @@ string
 VideoContent::processing_description () const
 {
        /* stringstream is OK here as this string is just for presentation to the user */
 VideoContent::processing_description () const
 {
        /* stringstream is OK here as this string is just for presentation to the user */
-       SafeStringStream d;
+       locked_stringstream d;
 
        if (size().width && size().height) {
                d << String::compose (
 
        if (size().width && size().height) {
                d << String::compose (
index a1673d3deafc58ae84950eec58314783eaf14ac4..47ceab5d1f2f4516f21b071081e4d298abf2f419 100644 (file)
@@ -21,8 +21,8 @@
 #include "video_content_scale.h"
 #include "video_content.h"
 #include "ratio.h"
 #include "video_content_scale.h"
 #include "video_content.h"
 #include "ratio.h"
-#include "safe_stringstream.h"
 #include "util.h"
 #include "util.h"
+#include <locked_sstream.h>
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
 #include <boost/optional.hpp>
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
 #include <boost/optional.hpp>
@@ -85,7 +85,7 @@ VideoContentScale::as_xml (xmlpp::Node* node) const
 string
 VideoContentScale::id () const
 {
 string
 VideoContentScale::id () const
 {
-       SafeStringStream s;
+       locked_stringstream s;
 
        if (_ratio) {
                s << _ratio->id ();
 
        if (_ratio) {
                s << _ratio->id ();
index 023226110c4d8de0a67e47224f33497991024587..3549e0947a22412794a7a91e1725e31ae64bc0b6 100644 (file)
@@ -84,7 +84,7 @@ VideoFilterGraph::can_process (dcp::Size s, AVPixelFormat p) const
 string
 VideoFilterGraph::src_parameters () const
 {
 string
 VideoFilterGraph::src_parameters () const
 {
-       SafeStringStream a;
+       locked_stringstream a;
 
        a << "video_size=" << _size.width << "x" << _size.height << ":"
          << "pix_fmt=" << _pixel_format << ":"
 
        a << "video_size=" << _size.width << "x" << _size.height << ":"
          << "pix_fmt=" << _pixel_format << ":"
index f5de27bf48a7d437aa3d78b1839e8a8d93cab39a..9883f31d6a6636407502170b26237632340cfeeb 100644 (file)
@@ -110,7 +110,6 @@ sources = """
           render_subtitles.cc
           resampler.cc
           rgba.cc
           render_subtitles.cc
           resampler.cc
           rgba.cc
-          safe_stringstream.cc
           scoped_temporary.cc
           scp_uploader.cc
           screen.cc
           scoped_temporary.cc
           scp_uploader.cc
           screen.cc
index 88310ad3ef42dc9d6f7dee1c3498b5f56fe8d59a..ac5b8a5448c15c91dd1b19264f5551f805893d92 100644 (file)
@@ -927,7 +927,7 @@ private:
                }
 
                for (size_t i = 0; i < history.size(); ++i) {
                }
 
                for (size_t i = 0; i < history.size(); ++i) {
-                       SafeStringStream s;
+                       locked_stringstream s;
                        if (i < 9) {
                                s << "&" << (i + 1) << " ";
                        }
                        if (i < 9) {
                                s << "&" << (i + 1) << " ";
                        }
index df828416f3fe5ad3e8d6ef3148a768ba7cf9ac6e..4c527ee0c59ca9afd29835af62f0c44a5ddcdb45 100644 (file)
@@ -29,7 +29,7 @@
 #include "lib/config.h"
 #include "lib/exceptions.h"
 #include "lib/emailer.h"
 #include "lib/config.h"
 #include "lib/exceptions.h"
 #include "lib/emailer.h"
-#include "lib/safe_stringstream.h"
+#include <locked_sstream.h>
 #include <dcp/certificate.h>
 #include <getopt.h>
 #include <iostream>
 #include <dcp/certificate.h>
 #include <getopt.h>
 #include <iostream>
@@ -82,7 +82,7 @@ time_from_string (string t)
 static boost::posix_time::time_duration
 duration_from_string (string d)
 {
 static boost::posix_time::time_duration
 duration_from_string (string d)
 {
-       SafeStringStream s (d);
+       locked_stringstream s (d);
        int N;
        string unit;
        s >> N >> unit;
        int N;
        string unit;
        s >> N >> unit;
index a23e56ccde8af84d72f75ed24298dca1917a7764..08a04f35cda0e753b240c40dd87630ae0beda87a 100644 (file)
@@ -191,7 +191,7 @@ private:
 
        void update_state ()
        {
 
        void update_state ()
        {
-               SafeStringStream s;
+               locked_stringstream s;
                s << fixed << setprecision(1) << server_log->fps ();
                _fps->SetLabel (std_to_wx (s.str()));
        }
                s << fixed << setprecision(1) << server_log->fps ();
                _fps->SetLabel (std_to_wx (s.str()));
        }
index 01b1ca056c1ed4739229f52c97fad917314bfd31..79365bf88e52534fcea6ff45113da6cc6172c532 100644 (file)
 */
 
 #include "lib/colour_conversion.h"
 */
 
 #include "lib/colour_conversion.h"
-#include "lib/safe_stringstream.h"
 #include "lib/raw_convert.h"
 #include "wx_util.h"
 #include "colour_conversion_editor.h"
 #include "lib/raw_convert.h"
 #include "wx_util.h"
 #include "colour_conversion_editor.h"
+#include <locked_sstream.h>
 #include <dcp/gamma_transfer_function.h>
 #include <dcp/modified_gamma_transfer_function.h>
 #include <wx/spinctrl.h>
 #include <dcp/gamma_transfer_function.h>
 #include <dcp/modified_gamma_transfer_function.h>
 #include <wx/spinctrl.h>
@@ -247,7 +247,7 @@ ColourConversionEditor::set (ColourConversion conversion)
 
        _ignore_chromaticity_changed = true;
 
 
        _ignore_chromaticity_changed = true;
 
-       SafeStringStream s;
+       locked_stringstream s;
        s.setf (std::ios::fixed, std::ios::floatfield);
        s.precision (6);
 
        s.setf (std::ios::fixed, std::ios::floatfield);
        s.precision (6);
 
@@ -394,7 +394,7 @@ ColourConversionEditor::update_bradford ()
        boost::numeric::ublas::matrix<double> m = get().bradford ();
        for (int i = 0; i < 3; ++i) {
                for (int j = 0; j < 3; ++j) {
        boost::numeric::ublas::matrix<double> m = get().bradford ();
        for (int i = 0; i < 3; ++i) {
                for (int j = 0; j < 3; ++j) {
-                       SafeStringStream s;
+                       locked_stringstream s;
                        s.setf (std::ios::fixed, std::ios::floatfield);
                        s.precision (7);
                        s << m (i, j);
                        s.setf (std::ios::fixed, std::ios::floatfield);
                        s.precision (7);
                        s << m (i, j);
@@ -409,7 +409,7 @@ ColourConversionEditor::update_rgb_to_xyz ()
        boost::numeric::ublas::matrix<double> m = get().rgb_to_xyz ();
        for (int i = 0; i < 3; ++i) {
                for (int j = 0; j < 3; ++j) {
        boost::numeric::ublas::matrix<double> m = get().rgb_to_xyz ();
        for (int i = 0; i < 3; ++i) {
                for (int j = 0; j < 3; ++j) {
-                       SafeStringStream s;
+                       locked_stringstream s;
                        s.setf (std::ios::fixed, std::ios::floatfield);
                        s.precision (7);
                        s << m (i, j);
                        s.setf (std::ios::fixed, std::ios::floatfield);
                        s.precision (7);
                        s << m (i, j);
@@ -442,7 +442,7 @@ ColourConversionEditor::set_spin_ctrl (wxSpinCtrlDouble* control, double value)
 void
 ColourConversionEditor::set_text_ctrl (wxTextCtrl* control, double value)
 {
 void
 ColourConversionEditor::set_text_ctrl (wxTextCtrl* control, double value)
 {
-       SafeStringStream s;
+       locked_stringstream s;
        s.precision (7);
        s << value;
        control->SetValue (std_to_wx (s.str ()));
        s.precision (7);
        s << value;
        control->SetValue (std_to_wx (s.str ()));
index c4238319c94430106f6e31defd8bbe19737fb83a..fcff93a068a2d0c3b9a38f15fb2f0e67e2eb2301 100644 (file)
@@ -205,7 +205,7 @@ DolbyDoremiCertificatePanel::finish_download (string serial, wxStaticText* messa
        } else {
                message->SetLabel (wxT (""));
 
        } else {
                message->SetLabel (wxT (""));
 
-               SafeStringStream s;
+               locked_stringstream s;
                BOOST_FOREACH (string e, errors) {
                        s << e << "\n";
                }
                BOOST_FOREACH (string e, errors) {
                        s << e << "\n";
                }
index 0853e4fcbb14d6f9ba9ba938f46204f07d89cd68..a18182138af0be609e4136315d329333f80ef4d8 100644 (file)
@@ -82,7 +82,7 @@ TimePicker::update_text ()
 
        _hours->SetValue (std_to_wx (raw_convert<string> (_hours_spin->GetValue ())));
 
 
        _hours->SetValue (std_to_wx (raw_convert<string> (_hours_spin->GetValue ())));
 
-       SafeStringStream m;
+       locked_stringstream m;
        m << setfill('0') << setw(2) << _minutes_spin->GetValue();
        _minutes->SetValue (std_to_wx (m.str()));
 
        m << setfill('0') << setw(2) << _minutes_spin->GetValue();
        _minutes->SetValue (std_to_wx (m.str()));
 
index 7a759314d8ba4713a7333b32856889746f662044..3ccfd2c35ea84dac9d503b8edc1fe7a4fada9433 100644 (file)
@@ -174,7 +174,7 @@ check_file (boost::filesystem::path ref, boost::filesystem::path check)
        uint8_t* ref_buffer = new uint8_t[buffer_size];
        uint8_t* check_buffer = new uint8_t[buffer_size];
 
        uint8_t* ref_buffer = new uint8_t[buffer_size];
        uint8_t* check_buffer = new uint8_t[buffer_size];
 
-       SafeStringStream error;
+       locked_stringstream error;
        error << "File " << check.string() << " differs from reference " << ref.string();
 
        while (N) {
        error << "File " << check.string() << " differs from reference " << ref.string();
 
        while (N) {
index 6f5d85a11045d4b2c17b9666f1853af33c62e528..e297d0cd231fcf38dee6e8af7c6726ddeb1c1893 100644 (file)
@@ -34,7 +34,7 @@ void
 test (dcp::Size content_size, dcp::Size display_size, dcp::Size film_size, Crop crop, Ratio const * ratio, bool scale, dcp::Size correct)
 {
        shared_ptr<Film> film;
 test (dcp::Size content_size, dcp::Size display_size, dcp::Size film_size, Crop crop, Ratio const * ratio, bool scale, dcp::Size correct)
 {
        shared_ptr<Film> film;
-       SafeStringStream s;
+       locked_stringstream s;
        s << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
                "<Content>"
                "<Type>FFmpeg</Type>"
        s << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
                "<Content>"
                "<Type>FFmpeg</Type>"