summaryrefslogtreecommitdiff
path: root/src/lib/util.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-08-23 22:50:40 +0100
committerCarl Hetherington <cth@carlh.net>2014-08-23 22:50:40 +0100
commit8c7a308c03e4b4196b4e2379a26d432b100ae2b1 (patch)
tree605c8b62f56c5f9be2ff77161eb18ac372083a35 /src/lib/util.cc
parent04acfa42cdffd5938358847ebee822399ef978e6 (diff)
parenta6d6a794b28c3b3e6679f01c1890f396453eb5ac (diff)
Merge master.
Diffstat (limited to 'src/lib/util.cc')
-rw-r--r--src/lib/util.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 60953b544..c9685aa44 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -22,7 +22,6 @@
* @brief Some utility functions and classes.
*/
-#include <sstream>
#include <iomanip>
#include <iostream>
#include <fstream>
@@ -72,6 +71,7 @@ extern "C" {
#include "rect.h"
#include "md5_digester.h"
#include "audio_processor.h"
+#include "safe_stringstream.h"
#ifdef DCPOMATIC_WINDOWS
#include "stack.hpp"
#endif
@@ -79,7 +79,6 @@ extern "C" {
#include "i18n.h"
using std::string;
-using std::stringstream;
using std::setfill;
using std::ostream;
using std::endl;
@@ -123,7 +122,7 @@ seconds_to_hms (int s)
int h = m / 60;
m -= (h * 60);
- stringstream hms;
+ SafeStringStream hms;
hms << h << N_(":");
hms.width (2);
hms << std::setfill ('0') << m << N_(":");
@@ -144,7 +143,7 @@ seconds_to_approximate_hms (int s)
int h = m / 60;
m -= (h * 60);
- stringstream ap;
+ SafeStringStream ap;
bool const hours = h > 0;
bool const minutes = h < 10 && m > 0;
@@ -263,7 +262,7 @@ stacktrace (ostream& out, int levels)
static string
ffmpeg_version_to_string (int v)
{
- stringstream s;
+ SafeStringStream s;
s << ((v & 0xff0000) >> 16) << N_(".") << ((v & 0xff00) >> 8) << N_(".") << (v & 0xff);
return s.str ();
}
@@ -889,7 +888,7 @@ divide_with_round (int64_t a, int64_t b)
string
dependency_version_summary ()
{
- stringstream s;
+ SafeStringStream s;
s << N_("libopenjpeg ") << opj_version () << N_(", ")
<< N_("libavcodec ") << ffmpeg_version_to_string (avcodec_version()) << N_(", ")
<< N_("libavfilter ") << ffmpeg_version_to_string (avfilter_version()) << N_(", ")