From 28a16b5e948909c787240513d6ed6219a224649b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 10 May 2017 15:59:42 +0200 Subject: [PATCH] decklink: Always use the video stream time for audio too The audio packet times can be completely unrelated to the video stream time, depending on the card. While this looks like a bug in the driver, just always using the video stream time (which is correct) works as a workaround for now. --- sys/decklink/gstdecklink.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sys/decklink/gstdecklink.cpp b/sys/decklink/gstdecklink.cpp index 2d49bb72fb..b01c90e637 100644 --- a/sys/decklink/gstdecklink.cpp +++ b/sys/decklink/gstdecklink.cpp @@ -768,6 +768,7 @@ public: gboolean no_signal = FALSE; GstClock *clock = NULL; HRESULT res; + BMDTimeValue stream_time = GST_CLOCK_TIME_NONE; g_mutex_lock (&m_input->lock); if (m_input->videosrc) { @@ -806,7 +807,6 @@ public: } if (got_video_frame && videosrc && video_frame) { - BMDTimeValue stream_time = GST_CLOCK_TIME_NONE; BMDTimeValue stream_duration = GST_CLOCK_TIME_NONE; IDeckLinkTimecode *dtc = 0; @@ -839,15 +839,8 @@ public: } if (got_audio_packet && audiosrc && audio_packet) { - BMDTimeValue packet_time = GST_CLOCK_TIME_NONE; - - res = audio_packet->GetPacketTime (&packet_time, GST_SECOND); - if (res != S_OK) { - GST_ERROR ("Failed to get stream time: 0x%08x", res); - packet_time = GST_CLOCK_TIME_NONE; - } m_input->got_audio_packet (audiosrc, audio_packet, capture_time, - packet_time, no_signal); + stream_time, no_signal); } else { if (!audio_packet) GST_DEBUG ("Received no audio packet at %" GST_TIME_FORMAT,