[0.11] gst-plugins-good: qtmux: Avoid a buffer metadata copy if possible

Wim Taymans wtay at kemper.freedesktop.org
Thu Oct 6 03:26:47 PDT 2011


Module: gst-plugins-good
Branch: 0.11
Commit: 4737090594bcdc7abac48be3993f3a457f430098
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=4737090594bcdc7abac48be3993f3a457f430098

Author: Thiago Santos <thiago.sousa.santos at collabora.co.uk>
Date:   Wed Sep 28 10:41:14 2011 -0300

qtmux: Avoid a buffer metadata copy if possible

If first_ts is 0 there is no need to subtract, so we might
skip some copying to make the buffer metadata writable.

---

 gst/isomp4/gstqtmux.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/gst/isomp4/gstqtmux.c b/gst/isomp4/gstqtmux.c
index 55b3f6b..fe6bf85 100644
--- a/gst/isomp4/gstqtmux.c
+++ b/gst/isomp4/gstqtmux.c
@@ -2128,7 +2128,8 @@ gst_qt_mux_add_buffer (GstQTMux * qtmux, GstQTPad * pad, GstBuffer * buf)
     buf = pad->prepare_buf_func (pad, buf, qtmux);
   }
 
-  if (G_LIKELY (buf != NULL && GST_CLOCK_TIME_IS_VALID (pad->first_ts))) {
+  if (G_LIKELY (buf != NULL && GST_CLOCK_TIME_IS_VALID (pad->first_ts) &&
+          pad->first_ts != 0)) {
     buf = gst_buffer_make_metadata_writable (buf);
     check_and_subtract_ts (qtmux, &GST_BUFFER_TIMESTAMP (buf), pad->first_ts);
   }



More information about the gstreamer-commits mailing list