summaryrefslogtreecommitdiff
path: root/src/dcp_time.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-09-12 14:36:52 +0100
committerCarl Hetherington <cth@carlh.net>2015-09-12 14:36:52 +0100
commit75356e094480bd7f96263a967a8cf165f4a2f818 (patch)
treea8308f40d89ca11e627de22c8af3205e88fa8ae9 /src/dcp_time.cc
parent6268703ea69149150a9b78381490463bc4822f92 (diff)
A number of SMPTE subtitle syntax fixes.
Diffstat (limited to 'src/dcp_time.cc')
-rw-r--r--src/dcp_time.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/dcp_time.cc b/src/dcp_time.cc
index 5e2e3121..19ab2de1 100644
--- a/src/dcp_time.cc
+++ b/src/dcp_time.cc
@@ -250,15 +250,21 @@ dcp::operator/ (Time a, Time const & b)
return float (at) / bt;
}
-/** @return A string of the form h:m:s:e padded as in 00:00:00:000 */
+/** @return A string of the form h:m:s:e padded as in 00:00:00:000 (for Interop) or 00:00:00:00 (for SMPTE) */
string
-Time::as_string () const
+Time::as_string (Standard standard) const
{
stringstream str;
str << setw(2) << setfill('0') << h << ":"
<< setw(2) << setfill('0') << m << ":"
- << setw(2) << setfill('0') << s << ":"
- << setw(3) << setfill('0') << e;
+ << setw(2) << setfill('0') << s << ":";
+
+ if (standard == SMPTE) {
+ str << setw(2) << setfill('0') << e;
+ } else {
+ str << setw(3) << setfill('0') << e;
+ }
+
return str.str ();
}