summaryrefslogtreecommitdiff
path: root/src/lib/subtitle_content.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-08-10 16:38:33 +0100
committerCarl Hetherington <cth@carlh.net>2016-08-12 09:13:51 +0100
commitb1dc9c3a2f7e55c9afc5bf2d5b465371b048e14f (patch)
tree9968238c6c0511f044e6fcdb4abcc08b5eb28f27 /src/lib/subtitle_content.cc
parent4a0ae92e28d7d1f0dd648d1b620efc324fdef161 (diff)
Remove all use of stringstream in an attempt to fix
the suspected thread-unsafe crash bugs on OS X.
Diffstat (limited to 'src/lib/subtitle_content.cc')
-rw-r--r--src/lib/subtitle_content.cc16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/lib/subtitle_content.cc b/src/lib/subtitle_content.cc
index 422bb6565..c7dc94875 100644
--- a/src/lib/subtitle_content.cc
+++ b/src/lib/subtitle_content.cc
@@ -24,7 +24,6 @@
#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>
@@ -249,19 +248,18 @@ SubtitleContent::as_xml (xmlpp::Node* root) const
string
SubtitleContent::identifier () const
{
- locked_stringstream s;
- s << raw_convert<string> (x_scale())
- << "_" << raw_convert<string> (y_scale())
- << "_" << raw_convert<string> (x_offset())
- << "_" << raw_convert<string> (y_offset())
- << "_" << raw_convert<string> (line_spacing());
+ string s = raw_convert<string> (x_scale())
+ + "_" + raw_convert<string> (y_scale())
+ + "_" + raw_convert<string> (x_offset())
+ + "_" + raw_convert<string> (y_offset())
+ + "_" + raw_convert<string> (line_spacing());
/* XXX: I suppose really _fonts shouldn't be in here, since not all
types of subtitle content involve fonts.
*/
BOOST_FOREACH (shared_ptr<Font> f, _fonts) {
for (int i = 0; i < FontFiles::VARIANTS; ++i) {
- s << "_" << f->file(static_cast<FontFiles::Variant>(i)).get_value_or ("Default");
+ s += "_" + f->file(static_cast<FontFiles::Variant>(i)).get_value_or("Default").string();
}
}
@@ -269,7 +267,7 @@ SubtitleContent::identifier () const
how this content looks.
*/
- return s.str ();
+ return s;
}
void