[Bug 782424] Vorbisenc/oggmux set incorrect duration

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Thu May 11 08:47:35 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=782424

Vincent Penquerc'h <vincent.penquerch at collabora.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vincent.penquerch at collabora
                   |                            |.co.uk

--- Comment #1 from Vincent Penquerc'h <vincent.penquerch at collabora.co.uk> ---
The root is in audioencoder, and is fixed by the following hack. However, I
don't think it's right since it'll cause "wrong" timestamps when it triggers. A
possible way out might be to always have an extra "safety margin" in base_ts,
but that's iffy as well.
In any case, that hack yields a 13.32 second output (was that the expected
duration ?).


diff --git a/gst-libs/gst/audio/gstaudioencoder.c
b/gst-libs/gst/audio/gstaudioencoder.c
index 5c3b97b..6a4f7e0 100644
--- a/gst-libs/gst/audio/gstaudioencoder.c
+++ b/gst-libs/gst/audio/gstaudioencoder.c
@@ -1325,7 +1325,12 @@ gst_audio_encoder_chain (GstPad * pad, GstObject *
parent, GstBuffer * buffer)
     }
     if (discont) {
       /* now re-sync ts */
-      priv->base_ts += diff;
+      if (diff < 0 && -diff > priv->base_ts) {
+        GST_WARNING_OBJECT (enc, "Unable to offset base_ts past 0, clipping to
0");
+        priv->base_ts = 0;
+      } else {
+        priv->base_ts += diff;
+      }
       gst_audio_encoder_set_base_gp (enc);
       priv->discont |= discont;
     }

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list