From febbaaddcf8de3eb1b5b27b17aea6cebec82a4b2 Mon Sep 17 00:00:00 2001 From: shakin chou Date: Wed, 26 Apr 2017 17:46:10 +0800 Subject: amcvideodec/enc: Correctly check for no PTS on input buffers MediaCodec gives us a presentation timestamp of 0 if it does not know anything, but GStreamer gives us GST_CLOCK_TIME_NONE. Don't mix up these two. https://bugzilla.gnome.org/show_bug.cgi?id=780190 --- sys/androidmedia/gstamcvideodec.c | 3 ++- sys/androidmedia/gstamcvideoenc.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/androidmedia') diff --git a/sys/androidmedia/gstamcvideodec.c b/sys/androidmedia/gstamcvideodec.c index 53d3879e2..bc82775d8 100644 --- a/sys/androidmedia/gstamcvideodec.c +++ b/sys/androidmedia/gstamcvideodec.c @@ -682,7 +682,8 @@ _find_nearest_frame (GstAmcVideoDec * self, GstClockTime reference_timestamp) best_id = id; /* For frames without timestamp we simply take the first frame */ - if ((reference_timestamp == 0 && timestamp == 0) || diff == 0) + if ((reference_timestamp == 0 && !GST_CLOCK_TIME_IS_VALID (timestamp)) + || diff == 0) break; } } diff --git a/sys/androidmedia/gstamcvideoenc.c b/sys/androidmedia/gstamcvideoenc.c index d457ce774..61c06bca1 100644 --- a/sys/androidmedia/gstamcvideoenc.c +++ b/sys/androidmedia/gstamcvideoenc.c @@ -730,7 +730,8 @@ _find_nearest_frame (GstAmcVideoEnc * self, GstClockTime reference_timestamp) best_id = id; /* For frames without timestamp we simply take the first frame */ - if ((reference_timestamp == 0 && timestamp == 0) || diff == 0) + if ((reference_timestamp == 0 && !GST_CLOCK_TIME_IS_VALID (timestamp)) + || diff == 0) break; } } -- cgit v1.2.1