diff options
author | shakin chou <shakin@outlook.com> | 2017-04-26 17:46:10 +0800 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-05-08 18:12:01 +0200 |
commit | 3852b7577024b3a1b9e88085e6133538b9045660 (patch) | |
tree | cd35f5deddf6d62950890373c8444fd49894f13f | |
parent | 979b70a9830c755151f568c9e3a895a8757123e7 (diff) | |
download | gstreamer-plugins-bad-3852b7577024b3a1b9e88085e6133538b9045660.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 bd772b739..be14c9fef 100644 --- a/sys/androidmedia/gstamcvideodec.c +++ b/sys/androidmedia/gstamcvideodec.c @@ -680,7 +680,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 66dc15a1a..a51e7a3dc 100644 --- a/sys/androidmedia/gstamcvideoenc.c +++ b/sys/androidmedia/gstamcvideoenc.c @@ -726,7 +726,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; } } |