diff mbox series

[FFmpeg-devel,2/3] avdevice/dshow: query graph time only once

Message ID 20210602132230.2380-3-dcnieho@gmail.com
State Superseded, archived
Headers show
Series avdevice/dshow: use video device timestamps | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Diederick C. Niehorster June 2, 2021, 1:22 p.m. UTC
No need to query twice, use value we've already unconditionally got.

Signed-off-by: Diederick Niehorster <dcnieho@gmail.com>
---
 libavdevice/dshow_pin.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavdevice/dshow_pin.c b/libavdevice/dshow_pin.c
index ee0d4a1b42..8408af26da 100644
--- a/libavdevice/dshow_pin.c
+++ b/libavdevice/dshow_pin.c
@@ -317,8 +317,8 @@  long ff_dshow_meminputpin_Receive(DShowMemInputPin *this, IMediaSample *sample)
     orig_curtime += pin->filter->start_time;
     IReferenceClock_GetTime(clock, &graphtime);
     if (devtype == VideoDevice && !ctx->use_video_device_timestamps) {
-            /* PTS from video devices is unreliable. */
-            IReferenceClock_GetTime(clock, &curtime);
+        /* PTS from video devices is unreliable. */
+        curtime = graphtime;
     } else {
         IMediaSample_GetTime(sample, &curtime, &dummy);
         if(curtime > 400000000000000000LL) {