From: Vishwanath Dixit <vdi...@akamai.com>
---
doc/indevs.texi | 6 ++++--
libavdevice/decklink_common_c.h | 1 +
libavdevice/decklink_dec.cpp | 4 ++++
libavdevice/decklink_dec_c.c | 1 +
4 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/doc/indevs.texi b/doc/indevs.texi
index 36aef49..0bc8e6a 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -298,11 +298,13 @@ Sets the audio input source. Must be
@samp{unset}, @samp{embedded},
@item video_pts
Sets the video packet timestamp source. Must be @samp{video},
@samp{audio},
-@samp{reference} or @samp{wallclock}. Defaults to @samp{video}.
+@samp{reference}, @samp{wallclock} or @samp{abs_wallclock}.
+Defaults to @samp{video}.
@item audio_pts
Sets the audio packet timestamp source. Must be @samp{video},
@samp{audio},
-@samp{reference} or @samp{wallclock}. Defaults to @samp{audio}.
+@samp{reference}, @samp{wallclock} or @samp{abs_wallclock}.
+Defaults to @samp{audio}.
@item draw_bars
If set to @samp{true}, color bars are drawn in the event of a signal
loss.
diff --git a/libavdevice/decklink_common_c.h
b/libavdevice/decklink_common_c.h
index 18097e2..08e9f9b 100644
--- a/libavdevice/decklink_common_c.h
+++ b/libavdevice/decklink_common_c.h
@@ -28,6 +28,7 @@ typedef enum DecklinkPtsSource {
PTS_SRC_VIDEO = 2,
PTS_SRC_REFERENCE = 3,
PTS_SRC_WALLCLOCK = 4,
+ PTS_SRC_ABS_WALLCLOCK = 5,
PTS_SRC_NB
} DecklinkPtsSource;
diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp
index 1fd40ca..c6eea43 100644
--- a/libavdevice/decklink_dec.cpp
+++ b/libavdevice/decklink_dec.cpp
@@ -607,6 +607,8 @@ static int64_t
get_pkt_pts(IDeckLinkVideoInputFrame *videoFrame,
res =
videoFrame->GetHardwareReferenceTimestamp(time_base.den, &bmd_pts,
&bmd_duration);
break;
case PTS_SRC_WALLCLOCK:
+ /* fall through */
+ case PTS_SRC_ABS_WALLCLOCK:
{
/* MSVC does not support compound literals like
AV_TIME_BASE_Q
* in C++ code (compiler error C4576) */
@@ -652,6 +654,8 @@ HRESULT
decklink_input_callback::VideoInputFrameArrived(
ctx->frameCount++;
if (ctx->audio_pts_source == PTS_SRC_WALLCLOCK ||
ctx->video_pts_source == PTS_SRC_WALLCLOCK)
wallclock = av_gettime_relative();
+ else if (ctx->audio_pts_source == PTS_SRC_ABS_WALLCLOCK ||
ctx->video_pts_source == PTS_SRC_ABS_WALLCLOCK)
+ wallclock = av_gettime();