diff options
author | shakin chou <shakin@outlook.com> | 2017-04-26 17:46:10 +0800 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-04-26 13:40:28 +0300 |
commit | febbaaddcf8de3eb1b5b27b17aea6cebec82a4b2 (patch) | |
tree | 30493ed665194f734302f17c40a223fad2ccc583 | |
parent | acfaf3a00150d3b283e5164fa1fc9489d30e1e0b (diff) | |
download | gstreamer-plugins-bad-febbaaddcf8de3eb1b5b27b17aea6cebec82a4b2.tar.gz |
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
-rw-r--r-- | sys/androidmedia/gstamcvideodec.c | 3 | ||||
-rw-r--r-- | sys/androidmedia/gstamcvideoenc.c | 3 |
2 files changed, 4 insertions, 2 deletions
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; } } |