[gst-cvs] gst-plugins-bad: asfmux: Warn if preroll value is too big

Thiago Sousa Santos thiagoss at kemper.freedesktop.org
Thu Jun 24 17:06:18 PDT 2010


Module: gst-plugins-bad
Branch: master
Commit: a267d287f5d0fdc1ac8bc14f49f2fc0cc15d275e
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=a267d287f5d0fdc1ac8bc14f49f2fc0cc15d275e

Author: Thiago Santos <thiago.sousa.santos at collabora.co.uk>
Date:   Thu Jun 24 20:21:15 2010 -0300

asfmux: Warn if preroll value is too big

Post a warning when the preroll value is greater than
the streams duration

---

 gst/asfmux/gstasfmux.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/gst/asfmux/gstasfmux.c b/gst/asfmux/gstasfmux.c
index 12bc7ad..4657a8b 100644
--- a/gst/asfmux/gstasfmux.c
+++ b/gst/asfmux/gstasfmux.c
@@ -73,6 +73,7 @@
 #endif
 
 #include <string.h>
+#include <gst/gst-i18n-plugin.h>
 #include "gstasfmux.h"
 
 #define DEFAULT_SIMPLE_INDEX_TIME_INTERVAL G_GUINT64_CONSTANT (10000000)
@@ -1783,6 +1784,14 @@ gst_asf_mux_stop_file (GstAsfMux * asfmux)
   GST_WRITE_UINT64_LE (GST_BUFFER_DATA (buf) + 24, (play_duration / 100) +
       ASF_MILI_TO_100NANO (asfmux->preroll));
   GST_WRITE_UINT64_LE (GST_BUFFER_DATA (buf) + 32, (play_duration / 100));      /* TODO send duration */
+
+  /* if play duration is smaller then preroll, player might have problems */
+  if (asfmux->preroll > play_duration / GST_MSECOND) {
+    GST_ELEMENT_WARNING (asfmux, STREAM, MUX, (_("Generated file has a larger"
+                " preroll time than its streams duration")),
+        ("Preroll time larger than streams duration, "
+            "try setting a smaller preroll value next time"));
+  }
   GST_WRITE_UINT64_LE (GST_BUFFER_DATA (buf) + 40, asfmux->preroll);
   GST_WRITE_UINT32_LE (GST_BUFFER_DATA (buf) + 48, 0x2);        /* flags - seekable */
   GST_WRITE_UINT32_LE (GST_BUFFER_DATA (buf) + 52, asfmux->packet_size);





More information about the Gstreamer-commits mailing list