[0.10] gst-plugins-base: video: Fix latency query handling if the element' s own max_latency is GST_CLOCK_TIME_NONE

Sebastian Dröge slomo at kemper.freedesktop.org
Wed Apr 25 04:53:16 PDT 2012


Module: gst-plugins-base
Branch: 0.10
Commit: 51ed23b6f7a0ab770488f4eeda173aa924eceefd
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=51ed23b6f7a0ab770488f4eeda173aa924eceefd

Author: Sebastian Dröge <sebastian.droege at collabora.co.uk>
Date:   Wed Apr 25 13:52:51 2012 +0200

video: Fix latency query handling if the element's own max_latency is GST_CLOCK_TIME_NONE

---

 gst-libs/gst/video/gstvideodecoder.c |    4 +++-
 gst-libs/gst/video/gstvideoencoder.c |    6 ++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c
index b1c58b8..140d2bc 100644
--- a/gst-libs/gst/video/gstvideodecoder.c
+++ b/gst-libs/gst/video/gstvideodecoder.c
@@ -1188,7 +1188,9 @@ gst_video_decoder_src_query (GstPad * pad, GstQuery * query)
 
         GST_OBJECT_LOCK (dec);
         min_latency += dec->priv->min_latency;
-        if (max_latency != GST_CLOCK_TIME_NONE) {
+        if (dec->priv->max_latency == GST_CLOCK_TIME_NONE) {
+          max_latency = GST_CLOCK_TIME_NONE;
+        } else if (max_latency != GST_CLOCK_TIME_NONE) {
           max_latency += dec->priv->max_latency;
         }
         GST_OBJECT_UNLOCK (dec);
diff --git a/gst-libs/gst/video/gstvideoencoder.c b/gst-libs/gst/video/gstvideoencoder.c
index f76b522..c567716 100644
--- a/gst-libs/gst/video/gstvideoencoder.c
+++ b/gst-libs/gst/video/gstvideoencoder.c
@@ -991,8 +991,10 @@ gst_video_encoder_src_query (GstPad * pad, GstQuery * query)
 
         GST_OBJECT_LOCK (enc);
         min_latency += priv->min_latency;
-        if (max_latency != GST_CLOCK_TIME_NONE) {
-          max_latency += priv->max_latency;
+        if (enc->priv->max_latency == GST_CLOCK_TIME_NONE) {
+          max_latency = GST_CLOCK_TIME_NONE;
+        } else if (max_latency != GST_CLOCK_TIME_NONE) {
+          max_latency += enc->priv->max_latency;
         }
         GST_OBJECT_UNLOCK (enc);
 



More information about the gstreamer-commits mailing list