summaryrefslogtreecommitdiff
path: root/src/lib/transcode_job.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/transcode_job.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/transcode_job.cc')
-rw-r--r--src/lib/transcode_job.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/lib/transcode_job.cc b/src/lib/transcode_job.cc
index 8e5660330..4eb2b1d29 100644
--- a/src/lib/transcode_job.cc
+++ b/src/lib/transcode_job.cc
@@ -28,7 +28,6 @@
#include "film.h"
#include "transcoder.h"
#include "log.h"
-#include <locked_sstream.h>
#include "compose.hpp"
#include <iostream>
#include <iomanip>
@@ -112,18 +111,21 @@ TranscodeJob::status () const
return Job::status ();
}
- locked_stringstream s;
-
- s << Job::status ();
-
- if (!finished () && !_transcoder->finishing ()) {
+ char buffer[256];
+ if (finished() || _transcoder->finishing()) {
+ strncpy (buffer, Job::status().c_str(), 256);
+ } else {
/// TRANSLATORS: fps here is an abbreviation for frames per second
- s << "; " << _transcoder->video_frames_enqueued() << "/"
- << _film->length().frames_round (_film->video_frame_rate ()) << " " << _("frames") << "; "
- << fixed << setprecision (1) << fps << " " << _("fps");
+ snprintf (
+ buffer, sizeof(buffer), "%s; %d/%" PRId64 " frames; %.1f fps",
+ Job::status().c_str(),
+ _transcoder->video_frames_enqueued(),
+ _film->length().frames_round (_film->video_frame_rate ()),
+ fps
+ );
}
- return s.str ();
+ return buffer;
}
/** @return Approximate remaining time in seconds */