projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ignore errors from avcodec_send_packet.
[dcpomatic.git]
/
src
/
lib
/
dcpomatic_time.cc
diff --git
a/src/lib/dcpomatic_time.cc
b/src/lib/dcpomatic_time.cc
index 6563c6e5f9a2835082082a0116ebe489e16a3e72..ac797f8f4205589c5ad605dc768deb83bbfed54e 100644
(file)
--- a/
src/lib/dcpomatic_time.cc
+++ b/
src/lib/dcpomatic_time.cc
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2014-20
16
Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-20
21
Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
This file is part of DCP-o-matic.
@@
-18,27
+18,33
@@
*/
*/
+
#include "dcpomatic_time.h"
#include <inttypes.h>
#include "dcpomatic_time.h"
#include <inttypes.h>
+
using std::string;
using std::string;
+using namespace dcpomatic;
+
template <>
Time<ContentTimeDifferentiator, DCPTimeDifferentiator>::Time (DCPTime d, FrameRateChange f)
template <>
Time<ContentTimeDifferentiator, DCPTimeDifferentiator>::Time (DCPTime d, FrameRateChange f)
- : _t (llrint
(d.get() * f.speed_up))
+ : _t (llrint(d.get() * f.speed_up))
{
}
{
}
+
template <>
Time<DCPTimeDifferentiator, ContentTimeDifferentiator>::Time (ContentTime d, FrameRateChange f)
template <>
Time<DCPTimeDifferentiator, ContentTimeDifferentiator>::Time (ContentTime d, FrameRateChange f)
- : _t (llrint
(d.get() / f.speed_up))
+ : _t (llrint(d.get() / f.speed_up))
{
}
{
}
+
DCPTime
DCPTime
-min (DCPTime a, DCPTime b)
+
dcpomatic::
min (DCPTime a, DCPTime b)
{
if (a < b) {
return a;
{
if (a < b) {
return a;
@@
-47,8
+53,9
@@
min (DCPTime a, DCPTime b)
return b;
}
return b;
}
+
DCPTime
DCPTime
-max (DCPTime a, DCPTime b)
+
dcpomatic::
max (DCPTime a, DCPTime b)
{
if (a > b) {
return a;
{
if (a > b) {
return a;
@@
-57,8
+64,9
@@
max (DCPTime a, DCPTime b)
return b;
}
return b;
}
+
ContentTime
ContentTime
-min (ContentTime a, ContentTime b)
+
dcpomatic::
min (ContentTime a, ContentTime b)
{
if (a < b) {
return a;
{
if (a < b) {
return a;
@@
-67,8
+75,9
@@
min (ContentTime a, ContentTime b)
return b;
}
return b;
}
+
ContentTime
ContentTime
-max (ContentTime a, ContentTime b)
+
dcpomatic::
max (ContentTime a, ContentTime b)
{
if (a > b) {
return a;
{
if (a > b) {
return a;
@@
-77,26
+86,41
@@
max (ContentTime a, ContentTime b)
return b;
}
return b;
}
+
string
string
-to_string (ContentTime t)
+
dcpomatic::
to_string (ContentTime t)
{
char buffer[64];
{
char buffer[64];
+#ifdef DCPOMATIC_WINDOWS
+ __mingw_snprintf (buffer, sizeof(buffer), "[CONT %" PRId64 " %fs]", t.get(), t.seconds());
+#else
snprintf (buffer, sizeof(buffer), "[CONT %" PRId64 " %fs]", t.get(), t.seconds());
snprintf (buffer, sizeof(buffer), "[CONT %" PRId64 " %fs]", t.get(), t.seconds());
+#endif
return buffer;
}
return buffer;
}
+
string
string
-to_string (DCPTime t)
+
dcpomatic::
to_string (DCPTime t)
{
char buffer[64];
{
char buffer[64];
+#ifdef DCPOMATIC_WINDOWS
+ __mingw_snprintf (buffer, sizeof(buffer), "[DCP %" PRId64 " %fs]", t.get(), t.seconds());
+#else
snprintf (buffer, sizeof(buffer), "[DCP %" PRId64 " %fs]", t.get(), t.seconds());
snprintf (buffer, sizeof(buffer), "[DCP %" PRId64 " %fs]", t.get(), t.seconds());
+#endif
return buffer;
}
return buffer;
}
+
string
string
-to_string (DCPTimePeriod p)
+
dcpomatic::
to_string (DCPTimePeriod p)
{
char buffer[64];
{
char buffer[64];
+#ifdef DCPOMATIC_WINDOWS
+ __mingw_snprintf (buffer, sizeof(buffer), "[DCP %" PRId64 " %fs -> %" PRId64 " %fs]", p.from.get(), p.from.seconds(), p.to.get(), p.to.seconds());
+#else
snprintf (buffer, sizeof(buffer), "[DCP %" PRId64 " %fs -> %" PRId64 " %fs]", p.from.get(), p.from.seconds(), p.to.get(), p.to.seconds());
snprintf (buffer, sizeof(buffer), "[DCP %" PRId64 " %fs -> %" PRId64 " %fs]", p.from.get(), p.from.seconds(), p.to.get(), p.to.seconds());
+#endif
return buffer;
}
return buffer;
}